title: How to Create Download Link
body: <p>What's the best way to create a download link? Is there a better way than the following?</p>
  
  <p>I was thinking of using <code>link_to "Download", :controller =&gt; ..., :action =&gt; ...", :id =&gt; ...</code> in the view.</p>
  
  <p>Adding <code>match /documents/download/:id =&gt; documents#download</code> to routes.rb</p>
  
  <p>And in the controller:</p>
  
  <pre><code>def download
    send_file ...
  end 
  </code></pre>
  
  <p>Also, I'd like, if possible, for the user to remain on the same page as the link.</p>
  
  <p>Thanks.</p>