Pods, pods, everywhere

This commit is contained in:
Matthew Dillon 2015-06-04 12:18:59 -08:00
parent 33f783bc42
commit e623d52f34
66 changed files with 53 additions and 113 deletions

View file

@ -0,0 +1,21 @@
import Ember from 'ember';
export default Ember.Controller.extend({
isEditing: true,
actions: {
save: function() {
var species = this.get('model');
if (species.get('isDirty')) {
species.save();
}
this.transitionToRoute('species.index');
},
cancel: function() {
var species = this.get('model');
if (species.get('isNew')) {
species.deleteRecord();
}
this.transitionToRoute('species.index');
}
}
});

View file

@ -0,0 +1,12 @@
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return this.store.createRecord('species');
},
actions: {
cancelSpecies: function() {
this.transitionTo('species.index');
}
}
});

View file

@ -0,0 +1,7 @@
{{
species-details
species=model
isEditing=true
save="save"
cancel="cancel"
}}