Skip to content

Commit 62095e8

Browse files
authored
Update associated record creation example
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.
1 parent e260565 commit 62095e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ You can use the association methods to build new objects and save them.
397397
@user.comments.build(body: "Just a draft")
398398
# => [#<Comment body="Just a draft" user_id=1>]
399399

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

0 commit comments

Comments
 (0)