Skip to content

Commit 51752b0

Browse files
author
Ed Jones
authored
Merge pull request #424 from mascott/patch-2
Update associated record creation example
2 parents 7af6748 + 62095e8 commit 51752b0

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
@@ -415,8 +415,8 @@ You can use the association methods to build new objects and save them.
415415
@user.comments.build(body: "Just a draft")
416416
# => [#<Comment body="Just a draft" user_id=1>]
417417

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

0 commit comments

Comments
 (0)