mardi 24 novembre 2015

How can I differentiate between 2 routes in Ember when resetNamespace: true?

I'm putting together an Ember 2.2 project and I have a modal that I want to open from 2 different places (i.e. show and index). My Router looks like this:

Router.map ->
  @route 'rules', path: '/', ->
    @route 'index', path: '/', ->
      @route 'activations', resetNamespace: true
    @route 'new'
    @route 'show', ->
      @route 'activations', resetNamespace: true
    @route 'edit'
    @route 'schedule'

This works just as I'd expect when I enter the url in the address bar. However, when I use the link-to helper in a template, it always redirects to /show/activations even if I'm in the index route:

app/templates/rules/index.emblem

li: link-to 'activations' | activations

the above redirects to /show/activations rather than /activations as I'd expect.




Aucun commentaire:

Enregistrer un commentaire