title: rails action_controller Processing by Controller ( #show as */* )
body: <p>I am sending an ajax request to one of my controller#action but my development log shows </p>
  
  <pre><code>Processing by FormsController#show as */*
  </code></pre>
  
  <p>while this should have been FormsController#show as JS as its an ajax request</p>
  
  <p>Due to this the its rendering the format that it finds first in my responds to block in the controller</p>
  
  <p>Eg:- </p>
  
  <pre><code>respond_to do |format|
    format.html{ }
    format.js { }
  end
  </code></pre>
  
  <p>if I send ajax request to my controller it doesn't work as expected as my controller renders html response while it should process JS request.</p>
  
  <p>But if the respond_to block is in this way</p>
  
  <pre><code>respond_to do |format|
    format.js { }
    format.html{ }
  end
  </code></pre>
  
  <p>It work as expected.</p>
  
  <p>I think</p>
  
  <pre><code>Processing by FormsController#show as */* 
  </code></pre>
  
  <p>is responding to which ever format it finds first in respond_to block.</p>
  
  <p>But my concern is why my development log is showing</p>
  
  <pre><code>Processing by FormsController#show as */*
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>Processing by FormsController#show as JS
  </code></pre>
  
  <p>when I have sent an ajax request. Am I doing something wrong or missing a small but important piece?</p>