title: Passing parameters between routes
body: <p>What is the "appropriate" way in Ember to send a parameter from one route to another? For instance, I have two routes defined as such:</p>
  
  <pre><code>this.resource('activities', { path: '/activities/:on_date' }, function() {
      this.route('new');
  });
  </code></pre>
  
  <p>when on the <code>ActivitiesRoute</code> the user is presented with a dropdown of possible activities. When they choose something it transitions to the <code>ActivitiesNewRoute</code>:</p>
  
  <pre><code>this.transitionToRoute('activities.new');
  </code></pre>
  
  <p>and I know there is a second parameter available in the <code>transitionToRoute(route,model)</code> method but it's meant for passing in a model and I'm assuming this shouldn't be repurposed for other parameter passing. In this case the dropdown choice is picking an <code>Action</code> model id and the model for ActivitiesNew is a <code>Activity</code>.</p>
  
  <p>Here are my three guesses at ways that might work:</p>
  
  <p><strong>1) Make it a router parameter</strong></p>
  
  <p>I supposed I could change <code>ActivitiesNew</code> to include a "parameter" as part of the route:</p>
  
  <pre><code>this.route('new', { path: '/new/:my_parameter' });
  </code></pre>
  
  <p>I'm not sure I'd really like to have it becoming part of the URL path but if this was the prevailing convention then I'd live with that.</p>
  
  <p><strong>2) Get a handle, post transition</strong></p>
  
  <p>Immediately following the transitionToRoute call I could set a property of the new controller class. Not sure if the controller would be setup yet but I'm imagining something like:</p>
  
  <pre><code>this.transitionToRoute('activities.new');
  this.get('target').controllerFor('activities.new').set('my_parameter', myValue);
  </code></pre>
  
  <p><strong>3) Use model parameter</strong></p>
  
  <pre><code>this.transitionToRoute('activities.new',myValue);
  </code></pre>
  
  <p>I suspect that this is a major no-no. I haven't looked into the Ember code to know if this could work but it seems against convention so this is my "bad option".</p>