I'm trying to redirect /dashboard/ to /dashboard/reach/demographic if the url hits /dashboard/.
Problem is, I still get redirected to /dashboard/reach/demographic/ if I hit a subroute like **/dashboard/traffic.
What is the Ember way of doing this?
Here is my code:
(function() { App.Router.map(function(match) { this.resource('dashboard', function() { this.resource('traffic', function() { this.route('visits'); this.route('pageviews'); return this.route('duration'); }); return this.resource('reach', function() { this.route('demographics'); this.route('over_time'); return this.route('devices'); }); }); return this.route('audience'); }); App.DashboardRoute = Ember.Route.extend({ redirect: function() { return this.transitionTo('reach.demographics'); } }); if (!App.ie()) { App.Router.reopen({ location: 'history' }); } App.reopen({ rootUrl: '/' }); }).call(this);