title: Queries in controller only if .js format (not if .html)
body: <p>Take the standard controller action redirect code:</p>
  
  <pre><code>respond_to do |format|
    format.html { redirect_to companies_url }
    format.js
  end
  </code></pre>
  
  <p>Is there a way to only perform a couple of additional queries if the format is .js?</p>