The following save
function commits the whole store. How can I commit just this
? this.commit();
doesn't work.
app.js
App.UserController = Ember.ObjectController.extend({
save: function() {
this.get('store').commit();
}
})
The following save
function commits the whole store. How can I commit just this
? this.commit();
doesn't work.
app.js
App.UserController = Ember.ObjectController.extend({
save: function() {
this.get('store').commit();
}
})
You can create a transaction, add a record to it, and then commit (or rollback) the transaction:
startEditing: function() {
this.transaction = this.get('store').transaction();
this.transaction.add(this.get('content');
},
save: function() {
this.transaction.commit();
}