From 82c22824a62ecbd253933d6943c9ad1d6e8e8eb7 Mon Sep 17 00:00:00 2001 From: jelhan Date: Wed, 4 Nov 2015 12:09:42 +0100 Subject: [PATCH] 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 --- app/routes/poll.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/routes/poll.js b/app/routes/poll.js index f3bf7ac..062cb34 100644 --- a/app/routes/poll.js +++ b/app/routes/poll.js @@ -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')}}); } });