I want a certain route to immediately redirect to /50
index: Ember.Route.extend({
route: '/',
redirectsTo: '/50',
}),
post: Ember.Route.extend({
route: '/:post_id',
connectOutlets: function(router) {
},
deserialize: function() {
}
})
Since redirectsTo
basically is just 'translated' to the call router.transitionTo(redirection)
inside connectOutlets
(see routable.js), you can solve your issue in a similar way, see http://jsfiddle.net/pangratz666/DLYQK/:
App.Router = Ember.Router.extend({
enableLogging: true,
root: Ember.Route.extend({
index: Ember.Route.extend({
route: '/',
connectOutlets: function(router) {
router.route('/50');
}
}),
post: Ember.Route.extend({
route: '/:post_id'
})
})
});
App.initialize();