Merge pull request #1888 from Patsy-issa/patch-1

Updated ember integration guide to use the proper renderer
This commit is contained in:
Benjamin Fleischer 2016-08-31 01:07:30 -05:00 committed by GitHub
commit ab85ce2b13

View File

@ -42,7 +42,9 @@ Lastly, in order to properly handle JSON API responses, we need to register a JS
```ruby ```ruby
# config/initializers/active_model_serializers.rb # config/initializers/active_model_serializers.rb
ActiveSupport.on_load(:action_controller) do
require 'active_model_serializers/register_jsonapi_renderer' require 'active_model_serializers/register_jsonapi_renderer'
end
``` ```
### Adapter Changes ### 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: So then in your controller, you'll want to be sure to have something like:
```ruby ```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: If you want to use `include` on a collection, you'd write something like this: