Skip to content

Commit

Permalink
Update nested resource creation example
Browse files Browse the repository at this point in the history
While the example is probably the intended behavior it does not reflect the current request path. I've updated the example to more closely match the current experience.

If one of the potential fixes like remi#318 is found to be acceptable it would make sense to include an update to the READ.me to reflect the changes.
  • Loading branch information
mascott authored Dec 2, 2016
1 parent e260565 commit dc9bd3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ You can use the association methods to build new objects and save them.
@user.comments.build(body: "Just a draft")
# => [#<Comment body="Just a draft" user_id=1>]

@user.comments.create(body: "Hello world.")
# POST "/users/1/comments" with `body=Hello+world.`
@user.comments.create(body: "Hello world.", user_id: 1)
# POST "comments" with `body=Hello+world.&user_id=1`
# => [#<Comment id=3 body="Hello world." user_id=1>]
```

Expand Down

0 comments on commit dc9bd3b

Please sign in to comment.