The typical case I’m thinking of is the one that appears on ember documentation of a post with comments. So I’ll describe an example situation situation:
- However, the only case in which it makes sense to get a post with its comments is when I’m viewing the post on itself in
/posts/:id. I do not want to load all the comments when I’m on
/postsas they are not needed.
I found this answer in stackoverflow in which they load the comments from the model by using the parent model.
I decided not to set the hasMany relation on
post as I did not want to load all comments all the time. Does this make sense? If so, how would I tell ember to load data from the
API/posts/:id/comments and still use the post information in the controller?
Or is there any common strategy to handle nested resources when it is unlikely to use all the information?
Also, I read this proposal because it seemed related: Nested URLs for Ember Data's RestAdapter proposal
Were any of the ideas implemented in the RESTAdapter? which ideas are recommended? Some suggested alternatives seem like hacks to me.