I was hoping to get some advice on displaying a template for a route which needs to have either a tabbed interface or a multiple paned interface to break up the content.
I’ve seen many ways of achieving this however not sure what is considered the best way in ember of achieving the result.
I’ve got a router
Rvr.Router.map(function() {
this.resource('requests');
this.resource('request', { path: '/requests/:request_id' });
});
Basically I’ve got a route/controller/template for requests that displays an array of requests in a table view and on each row is a link-to helper that links to the the individual request. That all works peachy however in the individual request there is a lot of data to display from the individual request model and I’d like to break that into various sections like “Project details”, “Research types”, “Investigators” using something like a tabbed interface e.g. Redirecting… or a master detail arrangement using those same sections but the one model.
How do people break up the template into various sub sections that’s shown/hidden depending on a tabbed/pilled/master interface?
I know I can’t use the tabs.js and need to handle the behaviour in ember which I’m fine with I’m just not sure what the best way to do this. I know I should be using urls as much as possible so I can have state. I’ve seen examples that don’t use the router however this seems like it’s trying to break out of how ember is supposed to work.
Should I be nesting routes inside the request resource?
Rvr.Router.map(function() {
this.resource('requests');
this.resource('request', { path: '/requests/:request_id' }, function () {
this.route('projectDetails');
this.route('researchTypes');
this.route('investigators');
});
});
According to the guides I’m only supposed to use routes for adjectives or verbs and what I’m describing are nouns. Should they be resources not routes? But I’m wanting to just use the request model and I don’t have a projectDetails model etc. Do routes and nested resources have access to the parents model?
Sorry if this is really obvious. I’m still pretty new to Ember and probably making lots of mistakes. Also, this maybe a pattern that I need to use elsewhere so I’m wondering if I should be developing something like a component that I can use elsewhere.
Any advice would be greatly appreciated.