Going back to model reference

This commit is contained in:
Matthew Dillon 2015-07-07 08:38:05 -08:00
parent 9aed858982
commit 4bbf931853
10 changed files with 17 additions and 66 deletions

View file

@ -3,7 +3,7 @@ import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
save: function() {
let species = this.get('species');
let species = this.get('model');
if (species.get('isDirty')) {
species.save().then((species) => {
@ -17,7 +17,7 @@ export default Ember.Controller.extend({
},
cancel: function() {
let species = this.get('species');
let species = this.get('model');
if (species.get('isNew')) {
species.deleteRecord();

View file

@ -3,13 +3,7 @@ import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixi
export default Ember.Route.extend(AuthenticatedRouteMixin, {
model: function() {
return Ember.RSVP.hash({
species: this.store.createRecord('species'),
});
},
setupController: function(controller, model) {
controller.setProperties(model);
return this.store.createRecord('species');
},
});

View file

@ -1,6 +1,6 @@
{{
forms/species-form
species=species
species=model
save="save"
cancel="cancel"
}}