should use redirect hook instead of afterModel
details: * http://guides.emberjs.com/v2.1.0/routing/redirection/#toc_child-routes * http://emberjs.com/api/classes/Ember.Route.html#method_redirect
This commit is contained in:
parent
b37a831d93
commit
82c22824a6
1 changed files with 4 additions and 4 deletions
|
@ -11,10 +11,6 @@ export default Ember.Route.extend({
|
|||
}
|
||||
},
|
||||
|
||||
afterModel(poll) {
|
||||
this.transitionTo('poll.participation', poll, {queryParams: {encryptionKey: this.get('encryption.key')}});
|
||||
},
|
||||
|
||||
encryption: Ember.inject.service(),
|
||||
|
||||
model: function(params) {
|
||||
|
@ -23,5 +19,9 @@ export default Ember.Route.extend({
|
|||
this.set('encryption.key', params.encryptionKey);
|
||||
|
||||
return this.store.find('poll', params.poll_id);
|
||||
},
|
||||
|
||||
redirect(poll) {
|
||||
this.transitionTo('poll.participation', poll, {queryParams: {encryptionKey: this.get('encryption.key')}});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue