I want to use both a parent route's model, and the child route's model from the child route. Not sure the "Ember way" to go about this.
To be a little more specific:
The parent
The parent route has a group model and has the dynamic route groups/:group_id
The child
Each group works on several units. In the template for the group route above, the list of units is displayed, each with a link to the child route in question, groups/:group_id/unit/:unit_id. The model for this route is the unit, set by passing the unit as an argument in the link-to helper in the parent route template.
The problem
The problem is that, in addition to the unit model, I also need to be able to access the parent model - the group, from within the groups/:group_id/unit/:unit_id route.
Its also a one way relationship. While a group has several units, any other group might also have any number of units, so I can't use the relationship.
I might set-up an hash to return both models in the child route.js, but the model hook wouldn't be executed if the model is passed via the link-to. Stuck on exactly how to do this. Or the other way is to maybe access the parent controller from the child controller, but not sure the correct way to do this.
Thanks