title: pass an array of Ids back from a view to a rails controller
body: <p>I have a form in which people can select a date, and click "filter". This date is then passed back to the controller as a parameter, and the view is reloaded with a list of users named @users</p>
  
  <p>I then have a form that I want to pass the @users back as an array</p>
  
  <p>I tried this</p>
  
  <pre><code>  = form_tag('/complete_export', :method =&gt; "put", :id =&gt; 'export') do |f|
      %p=hidden_field_tag "users", "#{@users.map(&amp;:id)}"
      %p=submit_tag("Export results »")
  </code></pre>
  
  <p>But when it gets back to the controller, the parameter arrives back looking like this...</p>
  
  <pre><code>[8] pry(#&lt;AccountsController&gt;)&gt; params[:users]
  "[53533, 51780, 17418, 153, 50667, 141, 48968, 48343, 48338, 47377, 44736, 40410, 27878, 172, 150, 34457, 37757, 26715, 31240, 31178, 30016, 184, 177, 196, 193, 155, 170]"
  </code></pre>
  
  <p>so it's actually coming back as a string. How do I pass it to the controller as an array, or change it in the controller into an array.</p>
  
  <p>EDIT</p>
  
  <p>So I have now amended my form as such...</p>
  
  <pre><code>  = form_tag('/complete_export', :method =&gt; "get", :id =&gt; 'export') do |f|
      - @users.each do |user|
        =hidden_field_tag :user_ids, :multiple =&gt; true, :value =&gt; user.id
      %p=submit_tag("Export results »")
  </code></pre>
  
  <p>Back in the controller, the params are showing as...</p>
  
  <pre><code>        "utf8" =&gt; "✓",
  "employee_ids" =&gt; "{:multiple=&gt;true, :value=&gt;170}",
        "commit" =&gt; "Export results »",
        "action" =&gt; "complete_payrite_export",
    "controller" =&gt; "accounts"
  </code></pre>
  
  <p>clearly I'm missing something :(</p>