Question

I often used routes with the path '/' to specify them as the default route. Now I noticed that it didnt work as expected with the link-to helper.

I used this in an older version of emberjs and I think it worked.

So when I have a language route with a dynamic segment which contains a courceCategories route that has the path '/' and use the {{#link-to "language" model}}click{{/link-to}} helper I get the following error:

Assertion failed: The attempt to link-to route 'language' failed (also tried 'language.index'). The router did not find 'language' in its possible routes: 'loading', 'error', 'languages', 'language.loading', 'language.error', 'language.courceCategories', 'index'

Why cant the router resolve this url?

demonstration: http://emberjs.jsbin.com/umeFeBe/2/edit

Thanks

Was it helpful?

Solution

This is a bug in Ember, and it's been reported here.

This PR should fix this, Try with the canary build once the PR is merged.

UPDATE: The PR has been merged, and this works now, check here

OTHER TIPS

That's because you're overriding the language.index value when you do the route / path inside its function. You now need to link to language.courceCategories

<script type="text/x-handlebars" data-template-name="languages">
  {{#each this}}
    {{#link-to "language.courceCategories" this}}{{id}}{{/link-to}}
  {{/each}}
</script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top