Best Practises for Nesting Routes question


#1

Hello, I am at a point where i have implemented an ember js app and currently reconfiguring my router (using pods).

Lets say i have a user that has many posts. I want three routes:

/users/:user_id -> user's profile
/users/:user_id/posts -> user's posts
/posts/:post_id

First of all I find annoying the fact that i should nest my posts index route, template and controller in a directory of the form

/users/show/posts 

whereas for the post route i should have the directory

/posts/show

Furthermore in the posts.index model hook I use the modelFor users.show command to get the user’s model however I do not wish my posts template to be rendered in the users.show template {{outlet}} but in the applications template {{outlet}} like the posts.show would be.

I feel like I am missing a vital part of ember’s route and template designing and I would appreciate any help for the above.

Thanks !