title: Help with this Rails code, (select and javascript)
body: <p>I need to have a select with options and JavaScript in each one, </p>
  
  <pre><code>**select...%&gt;**
   &lt;% @buscar.each do |j|%&gt;
   &lt;option value="&lt;%= j.cedula_tutor1 %&gt;" onclick="Datos2('j.cedula_tutor1');"&gt;
   &lt;%= j.cedula_tutor1 %&gt;
  &lt;/option&gt;
  &lt;%end%&gt;
   **&lt;/select&gt;**
  </code></pre>
  
  <p>This is what I have made in rails:</p>
  
  <pre><code>&lt;%=select("cedula_tutor1", "nombre",Tutore.all.collect{|u| [u.cedula_tutor1,u.nombre_tutor1]},{}, {:onchange =&gt; "Datos2('j.cedula_tutor1'))"})%&gt;
  </code></pre>
  
  <p>Of course that doesn't work because the <code>j.cedula_tutor1</code> is outside the loop.  How can I make it?  I just want to call a JavaScript function giving the <code>j.cedula_tutor</code> as parameters.</p>