title: RESTful Content Negotiation in Rails
body: <p>I'm looking to implement content negotiation on some resources in a Rails app.  I'm using Mootools and will likely be able to tweak the content type accepted by an XMLHTTPRequest to "application/json".</p>
  
  <p>Is there any way to pick up on this information in my controller and generate JSON responses instead of XHTML?</p>
  
  <p>I'm trying to avoid doing something like:</p>
  
  <pre><code>http://site/resource/1?format=JSON
  </code></pre>
  
  <p>...as it dirties up my URL, imposes a certain degree of redundancy and is not as flexible.</p>
  
  <p>Thanks!</p>