title: Uploading multiple files in rails 3
body: <p>I'm working on uploading multiple files but I'm not passing the params correctly between the form and the controller - not quite sure what I'm missing.</p>
  
  <p>Form is pretty simple:</p>
  
  <pre><code>&lt;%= form_tag({:controller =&gt; :admins, :action =&gt; :upload_json}, {:multipart =&gt; true, :method =&gt; :post, :html =&gt; { :class =&gt; "form-horizontal"}}) do %&gt;
  
    &lt;fieldset&gt;
      &lt;legend&gt;Data&lt;/legend&gt;
      &lt;ol class="field-list"&gt;
        &lt;li&gt;
          &lt;label for="data-file"&gt;JSON File&lt;/label&gt;
          &lt;%= file_field_tag 'jsonfileupload', multiple: true %&gt;
        &lt;/li&gt;
      &lt;/ol&gt;
  
  
      &lt;div class="form-actions"&gt;
        &lt;%= submit_tag "Upload" %&gt;
      &lt;/div&gt;
  
    &lt;/fieldset&gt;
  
  &lt;% end %&gt;
  </code></pre>
  
  <p>In the controller, I'm just doing this to see what's passed:</p>
  
  <pre><code>@output = params[:jsonfileupload]
  </code></pre>
  
  <p>In the view, I just do a <code>debug</code> to see what's returned, and it only pulls the last file of any set of selected files. </p>
  
  <pre><code>#&lt;ActionDispatch::Http::UploadedFile:0x007f95d0c21010 @original_filename="4987.json", @content_type="application/json", @headers="Content-Disposition: form-data; name=\"jsonfileupload\"; filename=\"4987.json\"\r\nContent-Type: application/json\r\n", @tempfile=#&lt;File:/var/folders/0p/6lq88m950mgftng1qm1w63_8000194/T/RackMultipart20121114-389-t9l7vs&gt;&gt;
  </code></pre>
  
  <p>Not sure what I'm missing to get it to return all the files selected. Thanks for the help!</p>