title: ruby rails converting params to int array
body: <p>I am sending data via get and I need to put it into a int array to be used in a find.
  here is my code :</p>
  
  <pre><code>@found = Array.new
    params['candidate'].each do |c|
    @found &lt;&lt; c.to_i
    end
  </code></pre>
  
  <p>My url looks like this </p>
  
  <pre><code>http://localhost:3000/export/candidate?candidate[]=3&amp;candidate[]=4&amp;commit=Export
  </code></pre>
  
  <p>If it makes any difference I am using it for this find</p>
  
  <pre><code>@candidate = Candidate.find(:all, :conditions =&gt; ["candidates.id IN ?", @found]) 
  </code></pre>
  
  <p>But currently it doesn't put it in a real array because I get this error</p>
  
  <pre><code>Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4)' at line 1: SELECT * FROM `candidates` WHERE (candidates.id IN 4,2)
  </code></pre>
  
  <p>The brackets are missing around the array</p>
  
  <p>Thanks and good morning!</p>
  
  <p>Alex</p>