title: Passing rails variable in a onclick function of check_box_tag
body: <p>I'm working with rails 3.0.
  In my view, I'm trying to have a table with a check box for each row, and an onclick event function with specific parameters wich are rails variable</p>
  
  <pre><code>&lt;table&gt;
      &lt;% @joueurs.each do |joueur| %&gt;
  &lt;tr&gt;
  &lt;td&gt;
  &lt;%= check_box_tag(joueur.id,joueur.id, false, :onclick=&gt;"addPlayerToField(&lt;%= joueur.gch %&gt;,&lt;%= joueur.drt %&gt;);")%&gt;
  &lt;/td&gt;
  ...
  &lt;/tr&gt;
  &lt;% end %&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I try many ways and I did not achieve to do it. I know the <code>joueurs.gch</code> variable is not empty and exist beacaus I use it elsewhere in my view.</p>
  
  <p>I want to generate  something like :</p>
  
  <pre><code>    &lt;table&gt;
      &lt;tr&gt;
  &lt;td&gt;
  &lt;input id="2036" name="2036" onclick="addPlayerToField(12, 13);" type="checkbox" value="2036"/&gt;
  &lt;/td&gt;
      &lt;/tr&gt;
         &lt;tr&gt;
  &lt;td&gt;
  &lt;input id="2037" name="2037" onclick="addPlayerToField(22, 10);" type="checkbox" value="2036"/&gt;
  &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
  </code></pre>