Skip to content

Instantly share code, notes, and snippets.

@bsylvain
Created April 26, 2018 14:12
Show Gist options
  • Select an option

  • Save bsylvain/541a37c0f7a0b85f9de3399d3d9ccca2 to your computer and use it in GitHub Desktop.

Select an option

Save bsylvain/541a37c0f7a0b85f9de3399d3d9ccca2 to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return this.get('store').createRecord('licence');
},
actions: {
saveLicence(newLicence) {
newLicence.save().then(() => this.transitionTo('licences'));
},
//built in ember action called when leaving a page
willTransition() {
this.controller.get('model').rollbackAttributes();
}
}
});
Assertion Failed: An action named 'saveLicence' was not found in <marketadmin@controller:licences/new::ember443>
{{interface/basic-button texte="Créer"
theAction=(action 'saveLicence' model)}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment