From 714c620ea23dab1d4cc10b1c8ae6cf8a8e8f0bf6 Mon Sep 17 00:00:00 2001 From: Patsy Issa Date: Mon, 22 Aug 2016 12:32:22 +0300 Subject: [PATCH 1/2] Updated to use the proper renderer --- docs/integrations/ember-and-json-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/ember-and-json-api.md b/docs/integrations/ember-and-json-api.md index 188fe21c..aab64d72 100644 --- a/docs/integrations/ember-and-json-api.md +++ b/docs/integrations/ember-and-json-api.md @@ -117,7 +117,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: From 77a4a27757517bd01706a12bc21c76ff7043356f Mon Sep 17 00:00:00 2001 From: Patsy Issa Date: Wed, 24 Aug 2016 10:42:01 +0300 Subject: [PATCH 2/2] Updated to use lazy loading when requiring --- docs/integrations/ember-and-json-api.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/integrations/ember-and-json-api.md b/docs/integrations/ember-and-json-api.md index aab64d72..11a0807e 100644 --- a/docs/integrations/ember-and-json-api.md +++ b/docs/integrations/ember-and-json-api.md @@ -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 -require 'active_model_serializers/register_jsonapi_renderer' +ActiveSupport.on_load(:action_controller) do + require 'active_model_serializers/register_jsonapi_renderer' +end ``` ### Adapter Changes