I'm trying to add new record to Ember Data store, and it expected to be displayed immediately. Spent few hours trying to figure out why it isn't displayed, and found, that passing parameters to Ember Data store.find prevents it.
So this code works:
App.FlagsRoute = Ember.Route.extend({
model: function(params) {
return this.store.find('flag');
}
});
App.FlagsController = Ember.ArrayController.extend({
init: function() {
this.store.createRecord('flag');
}
});
JSBin: http://jsbin.com/OxIDiVU/409/edit
There is one new record in the bottom of the table being displayed, as expected.
And when I'm adding only one thing, the params to 'find' query, it stops working.
So this code breaks new records diplaying:
App.FlagsRoute = Ember.Route.extend({
model: function(params) {
return this.store.find('flag', params);
}
});
JSBin: http://jsbin.com/OxIDiVU/407/edit
New record actually added to Ember Data store, but not shown in table.