Note that there are some explanatory texts on larger screens.

plurals
  1. PORender child records into specific outlet
    primarykey
    data
    text
    <p>I have this working example on <a href="http://jsfiddle.net/bazzel/SM5VM/" rel="nofollow">jsfiddle</a> where I'm showing a list of <strong>Posts</strong>. When a <strong>Post</strong> is selected, I display the details in the outlet of the posts template. No problem so far.</p> <p>Since every <strong>Post</strong> <em>has many</em> <strong>Comments</strong> and <em>has many</em> <strong>Trackbacks</strong>, I'd like to have the <strong>post/show</strong> template to show two tabs, so I can show either the comments or the trackbacks beneath the details.</p> <p>For this the post/show template looks like this:</p> <pre><code>&lt;script type="text/x-handlebars" data-template-name="post/show"&gt; &lt;h3&gt;{{controllers.post.title}}&lt;/h3&gt; &lt;p&gt;{{controllers.post.description}}&lt;/p&gt; &lt;hr/&gt; &lt;ul&gt; {{#linkTo comments tagName="li"}}&lt;a {{bindAttr href="view.href"}}&gt;Comments&lt;/a&gt;{{/linkTo}} {{#linkTo trackbacks tagName="li"}}&lt;a {{bindAttr href="view.href"}}&gt;Trackbacks&lt;/a&gt;{{/linkTo}} &lt;/ul&gt; {{outlet}} &lt;/script&gt; </code></pre> <p>The comments and trackbacks routes are basically identical:</p> <pre><code>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' }); } }); </code></pre> <p>My question is about <strong>renderTemplate</strong>: I would like to render the <strong>comments</strong> template into to <strong>outlet</strong> of the <strong>post/show</strong> template, but this is not working. When I replace the <strong>into</strong> value with another existing template (e.g. <strong>application</strong>, <strong>posts</strong>, <strong>post</strong>) I do see the <strong>comments</strong> appear.</p> <p>What I am doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload