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,19 @@
import Ember from 'ember';
export default Ember.Controller.extend({
isEditing: false,
actions: {
save: function() {
var strain = this.get('strain');
if (strain.get('isDirty')) {
strain.save();
}
this.toggleProperty('isEditing');
},
cancel: function() {
this.get('strain').get('errors').clear();
this.get('strain').rollback();
this.toggleProperty('isEditing');
}
}
});

View file

@ -0,0 +1,13 @@
import Ember from 'ember';
export default Ember.Route.extend({
model: function(params) {
return Ember.RSVP.hash({
strain: this.store.find('strain', params.strain_id),
species: this.store.findAll('species')
});
},
setupController: function(controller, models) {
controller.setProperties(models);
},
});

View file

@ -0,0 +1,8 @@
{{
strain-details
strain=strain
species=species
isEditing=isEditing
save="save"
cancel="cancel"
}}