The json I get from the API looks like this:
[
{
"id": "1",
"title": "title1"
},
{
"id": "2",
"title": "title2"
},
]
Unfortunately I can't change the API, so how do I get it to work with the RESTAdapter?
I tried with this code from this post :
App.ApplicationSerializer = DS.RESTSerializer.extend({
normalizePayload: function(type, payload) {
return { posts: payload };
}
});
But I get the error " Error while loading route: Error: No model was found for 'post' ".
Which I don't understand.
This is my posts Route.
App.PostsRoute = Ember.Route.extend({
model: function() {
return this.store.find('posts');
}
});