I am working with Ember 1.5.1 and Ember-data 1.0 beta and I am using the DS.RESTADAPTER CLASS.
I have two models, let say Post
and User
. The server replies at a GET request with the following JSON
{
data: [ .... ]
}
data
is an array of users
or posts
depending on the request.
The RestAdapter is designed around the idea that the JSON exchanged with the server should be conventional, and it expects the JSON returned from your server should look like this
{
posts: [ .... ]
}
or
{
users: [ .... ]
}
depending on the request.
How to customize ember-data to handle such situation?