You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I keep getting an error on page 79. This is how I have my friends edit route:
import Ember from 'ember';
export default Ember.Route.extend({
resetController(controller, isExiting) {
if (isExiting) {
var model = this.get('model');
model.rollback();
}
}
});
When I try to cancel an edit on a friend, I get this error:
Error while processing route: friends.show.index (2)
"model.rollback is not a function. (In 'model.rollback()', 'model.rollback' is undefined)"
Has anybody else had this problem?
The text was updated successfully, but these errors were encountered:
Just ran into this as well. There are actually two issues here. One in your code, one in the book. In your code, you have: var model = this.get('model');
That should be var model = controller.get('model');
The other issue is that either ember-data's api has changed slightly or the book just has the wrong method name. Rather than model.rollback()
It should be model.rollbackAtributes();
Hopefully you've already figured that out since you asked this a few months ago, but figured I'd post for any others that run into this problem.
This should be fixed in the current version and the repo is now
abuiles/borrowers-2016
On Sat, Jun 11, 2016 at 3:43 PM Brendon Davidson [email protected]
wrote:
Just ran into this as well. There are actually two issues here. One in
your code, one in the book. In your code, you have:
var model = this.get('model');
That should be
var model = controller.get('model');
The other issue is that either ember-data's api has changed slightly or
the book just has the wrong method name. Rather than
model.rollback()
It should be
model.rollbackAtributes();
Hopefully you've already figured that out since you asked this a few
months ago, but figured I'd post for any others that run into this problem.
I keep getting an error on page 79. This is how I have my friends edit route:
When I try to cancel an edit on a friend, I get this error:
Has anybody else had this problem?
The text was updated successfully, but these errors were encountered: