title: rails - DRY respond_to with repeated actions
body: <p>In one of my rails controller, I must respond to several types of formats, so I use the typical <code>respond_to</code> chain:</p>
  
  <pre><code>respond_to do |format|
    format.html   { ... }
    format.mobile { ... }
    format.jpg  { ... }
    format.xml  { ... }
    format.js   { ... }
  end
  </code></pre>
  
  <p>Usually that the <code>{ ... }</code> part is repeated on several formats. What is the best way to stay DRY on this case? On an scenario in which <code>html</code>, <code>mobile</code> and <code>xml</code> have a "repeated" action, I'd like to do something like this:</p>
  
  <pre><code>respond_to do |format|
    format[:html, :mobile, :xml] { ... }
    format.jpg  { ... }
    format.js   { ... }
  end
  </code></pre>
  
  <p>Thanks a lot.</p>