File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Integrating with Ember and JSON API
2
2
3
3
- [ Preparation] ( ./ember-and-json-api.md#preparation )
4
- - [ Adapter Changes] ( ./ember-and-json-api.md#adapter-changes )
4
+ - [ Server-Side Changes] ( ./ember-and-json-api.md#server-side-changes )
5
+ - [ Adapter Changes] ( ./ember-and-json-api.md#adapter-changes )
5
6
- [ Serializer Changes] ( ./ember-and-json-api.md#serializer-changes )
6
7
- [ Including Nested Resources] ( ./ember-and-json-api.md#including-nested-resources )
7
8
@@ -12,6 +13,21 @@ Note: This guide assumes that `ember-cli` is used for your ember app.
12
13
The JSON API specification calls for hyphens for multi-word separators. AMS uses underscores.
13
14
To solve this, in Ember, both the adapter and the serializer will need some modifications:
14
15
16
+ ### Server-Side Changes
17
+
18
+ there are multiple mimetypes for json that should all be parsed similarly, so
19
+ in ` config/initializers/mime_types.rb ` :
20
+ ``` ruby
21
+ api_mime_types = %W(
22
+ application/vnd.api+json
23
+ text/x-json
24
+ application/json
25
+ )
26
+
27
+ Mime ::Type .unregister :json
28
+ Mime ::Type .register ' application/json' , :json , api_mime_types
29
+ ```
30
+
15
31
### Adapter Changes
16
32
17
33
``` javascript
You can’t perform that action at this time.
0 commit comments