My Ember router looks similar to below.
App.Router.map(function() {
this.resource('projects', function () {
this.resource('listings', { path: '/:project_id/listings' }, function() {
this.route('listing', { path: '/:listing_id' });
});
});
});
I have 2 templates (projects, listings). The projects template has a {{#link-to}} helper that adds an anchor to the listings resource. The projects template is working fine. The {{#link-to}} helper also seems to generate the url correctly (~ /projects/2/listings).
Now the listings are rendered correctly but they are rendered inside the projects template. I assume this is because the resources are nested. So I removed the nesting and made both projects and listings as their own resources.
App.Router.map(function() {
this.resource('projects');
this.resource('listings', { path: 'projects/:project_id/listings' }, function() {
this.route('listing', { path: '/:listing_id' });
});
});
The problem is when the route transitions to listings, the listings template is not rendered. It's just blank. The below fiddle demonstrates the issue.