title: What's the proper way to access parameters from within Ember.Route. setupController?
body: <p><code>Ember.Route.model</code> has access to the <code>params</code> variable, but <code>Ember.Route.setupController</code> does not. This is troublesome for me, because my path has multiple dynamic segments, and I need to use all of them in my template.</p>
  
  <p>Specifically, my path looks like this: <code>/project/:project_id/task/:task_id</code>. Note that a task can belong to many projects, not just one. Therefore we can't tell what project we're looking at just be looking at the task itself: we have to use the project ID found in the URL. Here's how I'm doing it currently:</p>
  
  <pre><code>App.TaskRoute = Ember.Route.extend({
  
    // This works just fine:
    serialize: function(model) {
      return {
        task_id: model.get('id'),
        project_id: this.modelFor('project').get('id')
      };
    },
  
    model: function(params) {
      this.set('parentProjectId', params.project_id);
  
      return App.Task.find(params.task_id);
    },
  
    setupController: function(controller, model) {
      var parentProject = this.modelFor('project') ?
                          this.modelFor('project') :
                          App.Project.find(this.get('parentProjectId'));
      controller.set('parentProject', parentProject);
  
      controller.set('content', model);
    }
  });
  </code></pre>
  
  <p>Maybe I'm being paranoid, this just feels hacky. If the route was meant to have access to the parameters, then it would already have a <code>params</code> property attached to it. Is there a better way?</p>
  
  <p>EDIT: I made some update to the code above. Also, my routes look like this:</p>
  
  <pre><code>App.Router.map(function() {
    this.resource('project', { path: '/project/:project_id' });
    this.resource('task', { path: 'project/:project_id/task/:task_id' });
  });
  </code></pre>