When my route model uses this.store.find('user'), it is automatically updated, and the new entries created with are displayed in the template createRecord. So, the following works as expected:
Route:
model: function(){
return this.store.find('user');
}
Template:
{{
{{user.username}}<br>
{{/each}}
Controller Code:
var newUser = this.store.createRecord('user', {
username: this.get('username').trim()
});
If I change the route model to use the request parameter version find, the template is no longer updated when I docreateRecord
Route:
model: function(){
return this.store.find('user', {enabledOnly: false, limit: 100});
}
Controller Code:
// Triggered when form submitted to create a new user
var newUser = this.store.createRecord('user', {
username: this.get('username').trim()
});
// new user does not show up in template at all
It seems that this may be a mistake, since the only change in the code is the transition from the base find('user')to the version with query parameters. Is this the expected behavior for ember data? Why the model does not update the template after the call createRecordwhen the search version of the param request is used (i.e. find('user', {}))
jsbin, .
http://jsbin.com/kilaridoso/2/edit?html,js,output
!
:
DEBUG: -------------------------------
ember.debug.js:5197DEBUG: Ember : 1.11.1
ember.debug.js:5197DEBUG: Ember Data : 1.0.0-beta.16.1
ember.debug.js:5197DEBUG: jQuery : 1.11.3
ember.debug.js:5197DEBUG: Ember Simple Auth : 0.8.0-beta.2
ember.debug.js:5197DEBUG: -------------------------------