mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Update rendering.md
This commit is contained in:
parent
b9f4720cbd
commit
f2d59b20ca
@ -122,14 +122,15 @@ Specify the root by passing it as an argument to `render`. For example:
|
|||||||
render json: @user_post, root: "admin_post", adapter: :json
|
render json: @user_post, root: "admin_post", adapter: :json
|
||||||
```
|
```
|
||||||
|
|
||||||
This will produce serialize as:
|
This will be rendered as:
|
||||||
```json
|
```json
|
||||||
{"admin_post": {
|
{
|
||||||
|
"admin_post": {
|
||||||
"title": "how to do open source"
|
"title": "how to do open source"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
`Note: the Attributes adapter (default) does not include a resource root.`
|
Note: the `Attributes` adapter (default) does not include a resource root.
|
||||||
|
|
||||||
#### serializer
|
#### serializer
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user