title: Paperclip Downloading PDF Rails
body: <p>I've been searching around and have found answers to my question, although cant seem to figure out one detail. I am using Paperclip gem to upload/download files and I am able to upload/download pdf's. The problem I am having is that when I click download, it only downloads the most recently uploaded pdf.</p>
  
  <p>I want it to obviously download the pdf for the right document, instead of downloading the most recent one.</p>
  
  <p>This is the code I've used to display the document title/download link:</p>
  
  <p><code>&lt;%= document.title %&gt; &lt;%= link_to "Download", Document.last.pdf.url(:original, false) %&gt;</code></p>
  
  <p>I'm pretty sure I would have to change the <code>.last.pdf.url....</code> to something else, I'm just not sure what to change it to.</p>