title: Rails returning 406 Not Acceptable for ajax request
body: <p>I am completely stuck on this one and hours of searching hasn't turned up a result. I'm getting a 406 error when I try to do an ajax request. Here is my code..</p>
  
  <p>Tiers controller</p>
  
  <pre><code>    def index
        series = Series.find_by_id(params[:series_id])
        respond_to do |format|
          format.json { render :json =&gt; series.tiers }  
        end
      end
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>    $('#series_id').change -&gt;
        series_id = $('#series_id').val()
  
      $.get '/admin/tiers', {series_id:series_id}, (result) -&gt;
        element = $('select[name *= "tier_id"]')
        element.empty()
        $.each result, (index, item) -&gt;
          element.append $('&lt;option/&gt;', value:item.id, text: item.title)
  </code></pre>
  
  <p>And here is the error I am getting from the rails server</p>
  
  <pre><code>      Started GET "/admin/tiers/1" for 127.0.0.1 at 2013-01-21 14:19:38 +1100
        Processing by Admin::TiersController#index as JSON
          Parameters: {"series_id"=&gt;"1"}
          User Load (0.4ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
            (0.1ms)  begin transaction
            (0.5ms)  UPDATE "users" SET "last_request_at" = '2013-01-21 14:19:38.827810', "perishable_token" = 'y0TMicsW2l4zgSiQcJx', "updated_at" = '2013-01-21 14:19:38.829452' WHERE "users"."id" = 1
            (2.5ms)  commit transaction
          Tier Load (0.3ms)  SELECT "tiers".* FROM "tiers" WHERE "tiers"."id" IS NULL LIMIT 1
          Tier Load (0.3ms)  SELECT "tiers".* FROM "tiers" 
          Series Load (0.2ms)  SELECT "series".* FROM "series" 
          Series Load (0.2ms)  SELECT "series".* FROM "series" WHERE "series"."id" = 1 LIMIT 1
        Completed 406 Not Acceptable in 30ms (ActiveRecord: 4.4ms)
  </code></pre>
  
  <p>Really don't know what is stuffing it up, the controller looks fine and it looks like the content-type is json.</p>
  
  <p>I'm also using rails 3.2.11</p>