I'm having some difficults to render a content inside a template.
It seems to be a easy task to do, but I couldn't do anyway.
Some body can help me?
ApplicationView
<script type="text/x-handlebars" id="application">
<header class="logo"><!-- ... --></header>
<nav><!-- ... --></nav>
<hr class="top" />
{{outlet}}
<hr class="bottom" />
<footer><!-- ... --><div class="clear"></div>
</footer>
</script>
I have the route:
this.resource('exibition', {path: '/exposicoes/:exibition_id'}, function() {
this.route('artist', {path: '/artistas/:artist_id'});
});
Then the link exposicoes/2
shows the exposition page with id=2 on application outlet
, right?
The ExbitionView:
<script type="text/x-handlebars" id="exibition">
<div class="exibitions">
<h1>{{#link-to 'exibition'}}{{title}}{{/link-to}}</h1>
<div class="left">
<h2>Apresentação</h2>
{{{text}}}
</div>
<div class="right"><h2>Artistas</h2>
<ul>
{{#each artist in artists}}
<li>{{#link-to 'exibition.artist' artist}}{{artist.name}}{{/link-to}}</li>
{{/each}}
</ul>
</div>
<div class="clear"></div>
</div>
</script>
How can I make the artists links in the ExbitionView
open in the same area where is the {{{text}}}
replacing the content?
I tried use a outlet for this, some like:
<div class="left">
<h2>Apresentação</h2>
{{outlet showhere}}
</div>
And populate it with renderTemplate (and disconnectOutlet
to clearup) when ExbitionView are rendered, but if the user come back from /exibitions/2/artists/2
to /exibitions/2
using back button or even a link on page the content doesn't show again.