mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Merge pull request #1888 from Patsy-issa/patch-1
Updated ember integration guide to use the proper renderer
This commit is contained in:
commit
ab85ce2b13
@ -42,7 +42,9 @@ Lastly, in order to properly handle JSON API responses, we need to register a JS
|
||||
|
||||
```ruby
|
||||
# config/initializers/active_model_serializers.rb
|
||||
ActiveSupport.on_load(:action_controller) do
|
||||
require 'active_model_serializers/register_jsonapi_renderer'
|
||||
end
|
||||
```
|
||||
|
||||
### Adapter Changes
|
||||
@ -117,7 +119,7 @@ will generate the path `/posts/{postId}?include='comments'`
|
||||
|
||||
So then in your controller, you'll want to be sure to have something like:
|
||||
```ruby
|
||||
render json: @post, include: params[:include]
|
||||
render jsonapi: @post, include: params[:include]
|
||||
```
|
||||
|
||||
If you want to use `include` on a collection, you'd write something like this:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user