It is better to use the Ember nested routes. Each route has its own dynamic segment.
App.Router.map(function () { this.resource('albums', { path: '/albums' }, function () { this.resource('album', { path: ':album_id' }, function () { this.resource('tracks', { path: 'tracks' }, function () { this.resource('track', { path: ':track_id' }); }); }); }); });
If you want to show the user the first track immediately after clicking on the album, you can use the redirection.
App.AlbumRoute = Ember.Route.extend({ afterModel: function (album, transition) { this.transitionTo('track', {album_id: album.id, track_id: album.tracks[0].id}); }, });
Check redirected documents: http://emberjs.com/guides/routing/redirection/
source share