title: How to upload a text file and parse contents into database in RoR
body: <p>So far I've managed to upload a file:</p>
  
  <pre><code># In new.html.erb
  &lt;%= file_field_tag 'upload[file]' %&gt;
  </code></pre>
  
  <p>And access the file in the controller</p>
  
  <pre><code># In controller#create
  @text = params[:upload][:file]
  </code></pre>
  
  <p>However, this gives me just the filename, not the file's contents. How do I access its contents?</p>
  
  <p>I know this a jump, but once I can access the file's contents, would it all be possible to upload a folder and iterate through the files?</p>