I am building an app to track changes in results for different weight lifting movements.
I currently have the following routes defined. Lifts
have a nested lift
resource and a lift has results
.
App.Router.map(function() {
this.resource('lifts', function() {
this.route('new');
this.resource('lift', { path: '/:lift_id' }, function() {
this.route('edit');
this.route('result', { path: 'results/:result_id' });
});
});
});
I am having a problem rendering the output of a results
view template.
I have the following view templates defined:
<script type="text/x-handlebars" data-template-name="lifts">
<div class="row">
<div class="col-md-4">
<h1>Lifts</h1>
{{#each}}
<p>{{#link-to 'lift.result' this}}{{this.name}}{{/link-to}}</p>
{{/each}}
<p>{{#link-to 'lifts.new'}}Add a New Lift{{/link-to}}</p>
</div>
<div class="col-md-8">
<div>
{{outlet}}
</div>
</div>
</div>
<script type="text/x-handlebars" data-template-name="lift">
<h1>Lift Template</h1>
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="result">
<h1>Results</h1>
</script>
When I navigate to /lifts
in the browser, I see the list of lift names as expected. When I click on a lift name, I see the <h1>Lift Template</h1>
, but I do not see <h1>Results</h1>
nested inside of that template.
What is wrong with the current set up that is keeping the results view template from rendering inside of the {{outlet}}
defined in the lift view template?