title: how to use a pass a jquery variable to rails html
body: <p>how can i pass a jquery variable to a rails function in html. Here is what i want to accomplish:</p>
  
  <pre><code>&lt;%= select_tag :teams, options_from_collection_for_select(Fteam.all, "id", "Team") %&gt;
  </code></pre>
  
  <p>The selection from above gets put into a textbox here:</p>
  
  <pre><code>$(document).ready(function(){
  $('#teams').change(function(){
     $(this).val() != "" ? $('#myTextBox2').val($(this).val()) : $('#myTextBox2').hide();
  });
  });
  </code></pre>
  
  <p>How to i get it into this rails function below:</p>
  
  <pre><code>&lt;select id = "test3" style= float:right&gt;
  &lt;% Teamplayer.find_each(:conditions =&gt; :teamid =&gt; '#myTextBox2') do |tp| %&gt;
      &lt;option&gt; &lt;%=teamplayer.id %&gt;&lt;/option&gt;
      &lt;option&gt;Players on team 1&lt;/option&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p></p>
  
  <p>You see where in the find_each i am trying to put the value. I need the value to go from the textbox to to the find_each function so i can pull down the matching records from the database.</p>