title: 406 Not Acceptable error on jQuery :remote => true link
body: <p>I am submitting a delete request through an anchor tag link, and using :remote => true to submit it via JS to use jQuery. I've done this in two other instances which are identical to this, with no problem at all. But for some reason, this one is causing problems - whenever I submit I get a 406 Not Acceptable error.</p>
  
  <p><strong>the destroy link</strong></p>
  
  <pre><code>content_tag( :p, link_to("+#{vote.weight}", unvote_path(vote), :method =&gt; :delete, :remote =&gt; true ), :class =&gt; "chosen" )
  </code></pre>
  
  <p><strong>routes.rb</strong></p>
  
  <pre><code>delete "/unvote" =&gt; "votes#destroy", :as =&gt; :unvote
  </code></pre>
  
  <p><strong>votes_controller.rb</strong></p>
  
  <pre><code>def destroy
      @vote = Vote.find(params[:format])
      if !current_user.owns(@vote)
        flash[:alert] = "You cannot remove votes that aren't yours!"
      end
      @idea = @vote.idea
      @vote.destroy
  
      respond_with @vote do |format|
        format.js
        format.html { redirect_to category_idea_path(@idea.category, @idea) }
      end
  end
  </code></pre>
  
  <p><strong>destroy.js.erb</strong></p>
  
  <pre><code>$('#vote_buttons').append('&lt;%= escape_javascript get_vote_buttons(@idea.category, current_user, @idea) %&gt;');
  </code></pre>
  
  <p>That's exactly the same line that I have in <strong>new.js.erb</strong>, and that works fine (apart from the fact that it doesn't return exactly what I want, but it at least executes and appends correctly).</p>
  
  <p><strong>application.js</strong></p>
  
  <pre><code>jQuery.ajaxSetup({
      'beforeSend': function(xhr) { 
          xhr.setRequestHeader("Accept", "text/javascript");
      },
      cache: false
   });
  </code></pre>
  
  <p>And I've got that in <strong>application.js</strong> which should be setting the headers correctly, if I understand right.</p>
  
  <p>Also, please note that the link performs its delete functionality correctly - when I refresh the page manually, the Vote has been deleted. The only problem seems to be with the content being returned by <strong>destroy.js.erb</strong></p>
  
  <p>Any idea why this is acting differently to my other working examples? I've been beating my head against this all day and can't figure it out.</p>