Create and edit characteristics
This commit is contained in:
parent
fb296340c3
commit
de8ac653f6
14 changed files with 180 additions and 1 deletions
15
app/pods/protected/characteristics/edit/route.js
Normal file
15
app/pods/protected/characteristics/edit/route.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
import Ember from 'ember';
|
||||
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
|
||||
|
||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||
model: function(params) {
|
||||
return this.store.findRecord('characteristic', params.characteristic_id, { reload: true });
|
||||
},
|
||||
|
||||
afterModel: function(model) {
|
||||
if (!model.get('canEdit')) {
|
||||
this.transitionTo('characteristics.show', model.get('id'));
|
||||
}
|
||||
},
|
||||
|
||||
});
|
Reference in a new issue