Skip to content

Instantly share code, notes, and snippets.

@mhfs
Last active December 10, 2015 11:49
Show Gist options
  • Save mhfs/4430410 to your computer and use it in GitHub Desktop.
Save mhfs/4430410 to your computer and use it in GitHub Desktop.

This works:

App.Router.map(function(match) {
  match('/').to('index');
  match('/about').to('about');
  match('/contributor/:contributor_id').to('contributor');
});

As I can access /contributors/78422 successfully when linked like this:

{{#each contributor in controller}}
  <li>{{#linkTo contributor contributor}}{{contributor.login}}{{/linkTo}}</li>
{{/each}}

This doesn't work:

Now I was expecting to have these routes:

/contributor/78422
/contributor/78422/details
/contributor/78422/repos

With:

App.Router.map(function(match) {
  match('/').to('index');
  match('/about').to('about');
  match('/contributor/:contributor_id').to('contributor', function(){
    match('/details').to('details');
    match('/repos').to('repos');
  });
});

But I get this error when rendering the same template as above:

Uncaught Error: There is no route named contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment