Add new strain

This commit is contained in:
Matthew Dillon 2015-06-01 11:14:01 -08:00
parent c5b28f7204
commit dfc62cd1ac
6 changed files with 36 additions and 1 deletions

View file

@ -3,10 +3,15 @@ import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['grid-1'],
isEditing: false,
isNew: false,
actions: {
editStrain: function() {
this.get('strain').get('errors').clear();
if (this.get('isNew')) {
this.get('strain').destroyRecord().then(this.sendAction());
}
this.toggleProperty('isEditing');
this.get('strain').rollback();
},
saveStrain: function() {
this.get('strain').save().then(this.toggleProperty('isEditing'));