21 lines
480 B
JavaScript
21 lines
480 B
JavaScript
import Ember from 'ember';
|
|
|
|
export default Ember.Controller.extend({
|
|
isEditing: true,
|
|
actions: {
|
|
save: function() {
|
|
var strain = this.get('strain');
|
|
if (strain.get('isDirty')) {
|
|
strain.save();
|
|
}
|
|
this.transitionToRoute('strains.index');
|
|
},
|
|
cancel: function() {
|
|
var strain = this.get('strain');
|
|
if (strain.get('isNew')) {
|
|
strain.deleteRecord();
|
|
}
|
|
this.transitionToRoute('strains.index');
|
|
}
|
|
}
|
|
});
|