I have this working example on jsfiddle where I'm showing a list of Posts. When a Post is selected, I display the details in the outlet of the posts template. No problem so far.
Since every Post has many Comments and has many Trackbacks, I'd like to have the post/show template to show two tabs, so I can show either the comments or the trackbacks beneath the details.
For this the post/show template looks like this:
<script type="text/x-handlebars" data-template-name="post/show">
<h3>{{controllers.post.title}}</h3>
<p>{{controllers.post.description}}</p>
<hr/>
<ul>
{{#linkTo comments tagName="li"}}<a {{bindAttr href="view.href"}}>Comments</a>{{/linkTo}}
{{#linkTo trackbacks tagName="li"}}<a {{bindAttr href="view.href"}}>Trackbacks</a>{{/linkTo}}
</ul>
{{outlet}}
</script>
The comments and trackbacks routes are basically identical:
App.CommentsRoute = Em.Route.extend({
setupController: function (controller, model) {
comments = this.controllerFor('post').get('comments');
controller.set('content', comments);
},
renderTemplate: function () {
this.render({
into: 'post/show'
});
}
});
My question is about renderTemplate: I would like to render the comments template into to outlet of the post/show template, but this is not working. When I replace the into value with another existing template (e.g. application, posts, post) I do see the comments appear.
What I am doing wrong?