Reputation: 4339
When a user lands on my /settings
page, I want to redirect them to /settings/overview
. How can I accomplish this only when they land on /settings
, but not fire when they land on, for example, /settings/account
?
Upvotes: 1
Views: 45
Reputation: 47367
Create a SettingsIndexRoute
and redirect when they hit that route. The index route will only be hit when you hit the root of the resource.
App.SettingsIndexRoute = Em.Route.extend({
redirect: function(){
// I'm assuming overview is a route under settings
// and not a resource under it
this.transitionTo('settings.overview');
}
});
Upvotes: 1