0

I have this router

App.Router.map(function() {
    this.resource('about', function() {
        this.route('new');
    });
});

and

<script type="text/x-handlebars" data-template-name="about/new">
    <h1>About/New Page</h1>
</script>

However when I go to about/new route, I see the about template only. So, how do I render the template of a nested route?

Here's a jsfiddle: http://jsfiddle.net/C4gSE/

Jatin
  • 14,112
  • 16
  • 49
  • 78

2 Answers2

0

You need change the data-template-name from about to about/index. And the linkTo from about to about.index

Like this sample

Marcio Junior
  • 19,078
  • 4
  • 44
  • 47
  • okay! Also, one more thing, when I click on `about/new` both the `about` and `about.new` parts are 'active'. I mean, look at this fiddle : http://jsfiddle.net/fsP44/2/ Does that mean that `AboutNewController` will have all the properties of `AboutIndexController`? – Jatin Aug 17 '13 at 12:40
  • Use `linkTo 'about.index'`. Like this example http://jsfiddle.net/marciojunior/fsP44/3/ – Marcio Junior Aug 17 '13 at 19:08
0

The outlet helper is missing in about template. It should be

<script type="text/x-handlebars" data-template-name="about">
    <h2>About</h2>
    {{outlet}}
</script>
seenivasan
  • 186
  • 1
  • 4