{{#linkTo}} and nested routes confusion


#1

Hello friends,

I’m trying to build an Ember application and am currently experiencing a fair amount of frustration due to the following issue which I’ve outlined in a JSFiddle.

  • I have a basic route with one nested route.
  • Using the {{#linkTo}} helper, I’m able to navigate to the nested route.
  • However, I am unable to return to the parent route from the child.

It appears that the {{#linkTo}} helper depends on the context of the current view/route. Could someone please pity me and checkout this JSFiddle.


#2

Update: I’ve managed to get around this issue by moving away from nested routes. This being said, I would still love to understand what I’m doing wrong in the JSFiddle I provided.


#3

Just had a quick play with it

http://jsfiddle.net/VuYNs/9/

Any better?


#4

To go INTO posts/whatever, you need an {{outlet}} in your posts template. Your back button will simply link back to posts/index, at least in this case.

This is roughly an explanation of @jabulmer121’s fiddle really.


#5

I ran into pretty much the same issue yesterday, but I am using the {{action}} helper instead of {{#linkTo}}

http://jsfiddle.net/davidpett/SKkpW/ (correct working example)

I was just trying to transitionTo the category route passing context, when I needed to use category.index