title: How to access query parameters from an Ember controller
body: <p>I am working on a <a href="https://github.com/wholcomb/habit_tracker" rel="nofollow">habit tracking app</a>. I start off with a list of habits. When a user clicks a habit, it creates a new event for that habit. I have the list working, but I am having difficulty with the creation of the new event.</p>
  
  <p>To create a new event, I have this route:</p>
  
  <pre><code>App.Router.map( function() {
    ⋮
    this.resource( 'new_event', { path: '/event/new/:habit_id' } )
  } )
  </code></pre>
  
  <p>Then the associated router is:</p>
  
  <pre><code>App.NewEventRoute = Ember.Route.extend( {
    model: function(params) {
      return this.store.find( 'habit', params.habit_id )
    },
    setupController: function( controller, model ) {
      controller.set( 'selectedHabit', model )
    }
  } )
  </code></pre>
  
  <p>To the best of my knowledge, the only place I can access the query params is within the model function.</p>
  
  <p>The controller, then, is:</p>
  
  <pre><code>App.NewEventController = Ember.ObjectController.extend( {
    init: function() {
      console.log( 'init', this.get( 'selectedHabit' ) )
      // Logic for adding a new event for the habit
      this.transitionToRoute( 'events' )
    },
    selectedHabit: null,
    ⋮
  </code></pre>
  
  <p>The returned value for <code>selectedHabit</code> is <code>null</code>.</p>