-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update rendering.md #1557
Update rendering.md #1557
Conversation
-adding some documentation regarding overriding the root node.
@@ -155,7 +155,7 @@ PR please :) | |||
The resource root is derived from the class name of the resource being serialized. | |||
e.g. `UserPostSerializer.new(UserPost.new)` will be serialized with the root `user_post` or `user_posts` according the adapter collection pluralization rules. | |||
|
|||
Specify the root by passing it as an argument to `render`. For example: | |||
When using the JSON adapter in your initializer (ActiveModelSerializers.config.adapter = :json), you can specify the root by passing it as an argument to `render`. For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using the JSON adapter in your initializer (ActiveModelSerializers.config.adapter = :json)
You can also use render adapter: :json
to specify the adapter, so I think in your initializer (ActiveModelSerializers.config.adapter = :json)
might be misleading here.
Maybe it would be more clear to start the section by stating that root
only applies to JSON
adapter?
@Jwan622 Are you interested in making these suggested changes? |
Yes!! Sent from my iPhone
|
@Jwan622 wanna bring this one home? |
@Jwan622 👍 Can you squash these commits. I'll merge this once that's done. |
How... Do I do this? By squash you mean just turn it into one commit? I used the GUI... Sent from my iPhone
|
@Jwan622 I rebased it for you, added this to the CHANGELOG and merged it into master. Thanks for doing this! |
Thanks! Can you rebase squash using the github gui? Or does it have to be done command line? |
@Jwan622 you can squash using this technique in the command line: https://github.com/NullVoxPopuli/git-workflow/tree/master/single-repo#determine-how-many-commits-you-have-on-your-branch |
Purpose
Changes
Caveats
Related GitHub issues
Additional helpful information
-adding some documentation regarding overriding the root node.