bschaeffer
bschaeffer

Reputation: 2904

Ember.js: Ensure linkTo helper retains active class on a nested route

Take the following route:

@resource 'settings', path: '/settings', ->
  @route 'alerts'

and the following link:

{{#linkTo settings.index}}Settings{{/linkTo}}

Is there a specific way in Ember to ensure that the above link is .active as long as I am at a settings.* route?

Upvotes: 4

Views: 479

Answers (1)

Panagiotis Panagi
Panagiotis Panagi

Reputation: 10077

I'm pretty sure that if you instead use:

{{#linkTo "settings"}}Settings{{/linkTo}}

it will stay active as long as you are within the settings.* route. The above link will route to settings.index anyway.

Upvotes: 3

Related Questions