Skip to content

Commit ab85ce2

Browse files
authored
Merge pull request #1888 from Patsy-issa/patch-1
Updated ember integration guide to use the proper renderer
2 parents 0102434 + 77a4a27 commit ab85ce2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/integrations/ember-and-json-api.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ Lastly, in order to properly handle JSON API responses, we need to register a JS
4242

4343
```ruby
4444
# config/initializers/active_model_serializers.rb
45-
require 'active_model_serializers/register_jsonapi_renderer'
45+
ActiveSupport.on_load(:action_controller) do
46+
require 'active_model_serializers/register_jsonapi_renderer'
47+
end
4648
```
4749

4850
### Adapter Changes
@@ -117,7 +119,7 @@ will generate the path `/posts/{postId}?include='comments'`
117119

118120
So then in your controller, you'll want to be sure to have something like:
119121
```ruby
120-
render json: @post, include: params[:include]
122+
render jsonapi: @post, include: params[:include]
121123
```
122124

123125
If you want to use `include` on a collection, you'd write something like this:

0 commit comments

Comments
 (0)