When a route gets a bad parameter, why do route links with other parameters get an "active" class?
<p>I have an Ember site with a navigation bar that has multiple links to the same route but with different parameters, like this:</p>

<pre><code>{{link-to '1' 'foo' 1}}
{{link-to '2' 'foo' 2}}
</code></pre>

<p>When I click on a link, it goes to the right page, and the link gets an <code>active</code> class, as expected.</p>

<p>However, when I enter a URL with a <em>bad</em> parameter for the same route (e.g. <code>/foo/bar</code>), it goes to my <code>error</code> route as expected, but it adds an <code>active</code> class to all <code>foo</code> links. I would expect that <em>none</em> of these <code>foo</code> links would appear active.</p>

<hr>

<p>I can produce this behaviour with a very simple <code>ember-cli</code> app. All I have to do is run <code>ember new foobar</code> and add/edit a few files as shown below:</p>

<pre><code>/* app/router.js */

import Ember from 'ember';
import config from './config/environment';

const Router = Ember.Router.extend({
  location: config.locationType
});

Router.map(function() {
  this.route('foo', {path: 'foo/:foo_id'});
});

export default Router;


/* app/routes/foo.js */

import Ember from 'ember';

export default Ember.Route.extend({
  model(params) {
    if (params.foo_id !== '1' &amp;&amp; params.foo_id !== '2') {
      throw 'error';
    }
  }
});


/* app/routes/error.js */

import Ember from 'ember';

export default Ember.Route.extend({
});


/* app/templates/application.hbs */

{{link-to '1' 'foo' 1}}
{{link-to '2' 'foo' 2}}
</code></pre>

<p>Then, when I run <code>ember s</code> and go to <code>http://localhost:4200/foo/bar</code> in my browser, all the links have the <code>active</code> class.</p>

<hr>

<p>Is this an Ember bug, or am I doing something wrong, or is this the way Ember is designed to work? In any case, how can I prevent Ember from adding an <code>active</code> class to <code>foo</code> links when the user goes to a bad <code>foo</code> URL?</p>