I'm using the ember-data
last version with an important problem I 'm trying to solve.
The find
function by id works perfect and the proper record is loaded into the Data Store so I can obtain the attributes that I want in the template for render them.
App.PostRoute = Ember.Route.extend({
model: function(params) {
return this.store.find('post', params.post_id);
}
});
On the other side, the findAll
function doesn't work for me and the problem is Ember doesn't throw any error. In addition, Ember doesn't load any record and besides that I don't know how to iterate over the RecordArray
returned in the template.
App.PostsRoute = Ember.Route.extend({
model: function() {
return this.store.find('post');
}
});
Any suggestions? Thanks for the help.
{"id":"1","attribute1":"value1", ...,"attributen": "valuen"}
while my JSON response for all posts is[{"id":"1","attribute1":"value1", ...,"attributen": "valuen"},{"id":"2","attribute1":"value1", ...,"attributen": "valuen"}]
. I'm aware of my no ember standard response so I'm usingRESTSerializer
. – akruspeTRANSITION.md
one with 'serializerIntoHash,
extractSingle` andextractArray
functions but finally I gonna forget this serializer system and I gonna use a JSON response according to Ember so it works now. Thanks! – akruspe