Given that you say that the two sections (the list of players based on page_id and information about the player based on player_id ) are completely independent, it seems to me that you wouldn’t nest the routes, but instead use the two named outputs (name them left and right , or page and player , etc.) that you selectively render.
Router:
App.Router.map(function() { this.resource('page', { path: ':page_id' }); this.resource('player', { path: ':player_id' }); });
application.hbs:
{{outlet page}} {{outlet player}}
And then you can override renderTemplate for your page and player routes to render into the appropriate template. To clarify, the page route will display what you currently have as the players route (it depends on page_id, but there are many players on the page, so the route displays players based on the page), and the player route displays information about the player on based on player_id .
(As a side note, I don’t think you can invest resources the way you do right now by placing resource player under resource players - I think that only routes can be nested.)
EDIT: Using the same route with multiple dynamic segments
I think your suggestion might work. From a related example, it seems that you need to create “parent” resources (not nested routes, but having more general paths, such as / page / and / page /: page_id / player /: player_id) anyway. Then you can customize your models individually using model on the appropriate route and simply provide a serialize hook for the dual dynamic segment route:
serialize: function(model) { return { page_id : this.modelFor('page').get('id') player_id : this.modelFor('player').get('id') }; }
Please note: we do not rely on the model object that was transferred because you said that the page and player panels can be completely independent, so instead we use modelFor .
I think you can also handle your logic about the default page for rendering / the default player for rendering if none of them are proposed here using redirect .
Finally, you would redefine renderTemplate in your PagePlayer route to actually do the rendering:
renderTemplate: function(model, controller) { this.render("page", { into: "page" }); this.render("player", { into: "player"}); }
I think you should be careful not to display patterns in more general routes, because if you go from / page / 1 / player / 2 to / page / 1 / player / 3, the page route has NOT re-entered.