We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d4f0c5 commit d153dfeCopy full SHA for d153dfe
docs/general/rendering.md
@@ -113,8 +113,25 @@ PR please :)
113
114
#### root
115
116
-PR please :)
+By default the Json Adapter `root` will follow snake case format, like so:
117
+
118
+| resource | single root | collection root |
119
+|----------|-------------|-----------------|
120
+| UserPost | user_posts | user_post |
121
122
+If you would like to change the `root` of your json, specify it in the render call:
123
124
+```ruby
125
+ render json: @user_post, root: "admin_post"
126
+```
127
128
+This will produce json like:
129
+```json
130
+ {"admin_post": {
131
+ "title": "how to do open source"
132
+ }
133
134
135
#### serializer
136
137
PR please :)
0 commit comments