title: How do I use dynamic segments in EmberJS' 2.2 router?
body: <p>I can't figure out how to create routes with dynamic segments in the new router API for EmberJS. I've spent a week on it and tried many things but it doesn't work. I am really frustrated at myself because I've gone through the docs, API and source code many times and cannot figure out how to make this work. I am dying for assistance.</p>
  
  <p>I am trying to achieve the following routes:</p>
  
  <ul>
  <li>/profile/:userId -> index</li>
  <li>/profile/:userId/activity -> activity page</li>
  <li>/profile/:userId/...</li>
  </ul>
  
  <p>My router is set up like this</p>
  
  <pre><code>App.Router.map(function() {
    return this.resource("profile", function() {
      this.route("index", { path: '/:userId' });
      this.route("activity", { path: '/:userId/activity' });
    });
  });
  </code></pre>
  
  <p>Then, whenever I try to link with the <code>linkTo</code> helper, I receive the following error: <code>Uncaught More objects were passed than dynamic segments</code></p>
  
  <pre><code>&lt;li&gt;{{#linkTo "profile.index" user}}overview{{/linkTo}}&lt;/li&gt;
  </code></pre>
  
  <p>If I don't include the <code>user</code> object, then I receive another error <code>Uncaught Error: assertion failed: Cannot call get with 'id' on an undefined object.</code> (obviously because there's no object to take the ID of)</p>
  
  <p>If it's any helper, here are my route declarations</p>
  
  <pre><code>App.ProfileIndexRoute = Ember.Route.extend({
    model: function(params) {
      return Ember.Object.create({
        id: 1
      });
    },
    setupController: function(controller, model) {
      return controller.set("content", model);
    }
  });
  
  App.ProfileActivityRoute = Ember.Route.extend({
    model: function(params) {
      return Ember.Object.create({
        id: 1
      });
    },
    setupController: function(controller, model) {
      return controller.set("content", model);
    }
  });
  </code></pre>