title: How to find a File path in Rails
body: <p>I'm using the .foreach method from the <a href="http://www.ruby-doc.org/stdlib/libdoc/csv/rdoc/classes/CSV.html" rel="nofollow">Ruby CSV library</a> and I need help in finding a path to a file within my rails application. </p>
  
  <pre><code> CSV.foreach("path/to/file.csv") do |row|
      # use row here...
    end
  </code></pre>
  
  <p>To upload CSV files I'm using the <a href="https://github.com/thoughtbot/paperclip" rel="nofollow">Paperclip gem</a> which has a method .url for the file location:</p>
  
  <pre><code>CSV.foreach(CsvUpload.last.csvfile.url) do |row|
     #more code
  end
  
    CsvUpload Load (0.2ms)  SELECT `csv_uploads`.* FROM `csv_uploads` ORDER BY csv_uploads.id DESC LIMIT 1
  No such file or directory - /system/csvfiles/17/original/uploadthis.csv?1305217588
  </code></pre>
  
  <p>The actual path of the file is:  <code>/Users/boris/projects/chaggregator/public/system/csvfiles/17/original/uploadthis.csv?1305217588</code></p>
  
  <p><strong>Is there a Rails method for getting the full path?</strong></p>