Skip to content

Instantly share code, notes, and snippets.

@lessless
Last active August 29, 2015 14:16
Show Gist options
  • Save lessless/91911aad91857ea949c8 to your computer and use it in GitHub Desktop.
Save lessless/91911aad91857ea949c8 to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Route.extend({
actions: {
saveModel: function() {
Ember.RSVP.all([
this.currentModel.save(),
this.currentModel.get('notifications').save()
]).then( () => {
this.showFlashNow('Saved Successfully!', 'success');
}).catch( () => {
this.showFlashNow('Saved Successfully!', 'alert');
});
}
},
deactivate: function() {
this.currentModel.rollback();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment