From 2dc78c59162e5f0820e2b04ccb19da54ee7f7060 Mon Sep 17 00:00:00 2001 From: "L. Preston Sego III" Date: Tue, 1 Dec 2015 14:49:57 -0500 Subject: [PATCH] add information about server side changes --- docs/integrations/ember-and-json-api.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/integrations/ember-and-json-api.md b/docs/integrations/ember-and-json-api.md index f0e6b5fb..cf2e52ae 100644 --- a/docs/integrations/ember-and-json-api.md +++ b/docs/integrations/ember-and-json-api.md @@ -1,7 +1,8 @@ # Integrating with Ember and JSON API - [Preparation](./ember-and-json-api.md#preparation) - - [Adapter Changes](./ember-and-json-api.md#adapter-changes) + - [Server-Side Changes](./ember-and-json-api.md#server-side-changes) + - [Adapter Changes](./ember-and-json-api.md#adapter-changes) - [Serializer Changes](./ember-and-json-api.md#serializer-changes) - [Including Nested Resources](./ember-and-json-api.md#including-nested-resources) @@ -12,6 +13,21 @@ Note: This guide assumes that `ember-cli` is used for your ember app. The JSON API specification calls for hyphens for multi-word separators. AMS uses underscores. To solve this, in Ember, both the adapter and the serializer will need some modifications: +### Server-Side Changes + +there are multiple mimetypes for json that should all be parsed similarly, so +in `config/initializers/mime_types.rb`: +```ruby +api_mime_types = %W( + application/vnd.api+json + text/x-json + application/json +) + +Mime::Type.unregister :json +Mime::Type.register 'application/json', :json, api_mime_types +``` + ### Adapter Changes ```javascript