我做了什么 -
模型 -
App.Book = DS.Model.extend({
book_name: DS.attr('string'),
edition: DS.attr('string')
});
路由器 -
App.Router.map(function() {
this.resource('books', function() {
this.route('new');
});
});
App.BooksNewRoute = Ember.Route.extend({
model: function() {
return this.store.createRecord('book');
},
actions: {
save: function() {
this.modelFor('newBook').save();
}
}
});
现在有人可以帮我..如何保存数据?
我收到类似的错误
TypeError: this.modelFor(...) is undefined
this.modelFor('newBook').save();