add information about server side changes

This commit is contained in:
L. Preston Sego III 2015-12-01 14:49:57 -05:00
parent 21fe3abdfc
commit 2dc78c5916

View File

@ -1,6 +1,7 @@
# Integrating with Ember and JSON API
- [Preparation](./ember-and-json-api.md#preparation)
- [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