title: Is their any way?I could get the value of dropdown to use in controller using onchange event handler in ruby on rails application
body: <p>I want to call a method using <em>onchange</em> event handler when a user changes the value on a dropdown.Below is the code for my dropdown box.</p>
  
  <pre><code>&lt;%= select_tag :name,options_for_select(@tests.map{|u| [u.name]}.uniq),:onchange =&gt; 'update_dropdown(:name)' %&gt;
  </code></pre>
  
  <p>In the controller i want a method.which takes the value of selection in dropdown as paramater:<br>
  Below code searches database for the document with value of the parameter given from view.And return the document.What are the changes i have to make to get the selection in the controller as the dropdown values are changed! </p>
  
  <pre><code>def update_dropdown(name)
      @drop = Test.where("name" =&gt; name)
  end
  </code></pre>
  
  <p>How to get the selection value from view into the controller as parameter?<br>
  I has a mongoDatabase with documents(row) consisting key named:<em>name</em>.I has 4 unique values under key <em>name</em>.I want user to select the value using dropdown.As the user selected the dropdown.Without page refresh the documents consisting values selected with the key <em>name</em> should be displayed.<br>
  Ex:under key <em>name</em>.I has four values for 200 documents.named:<br>
   ["value1","value2","value3","value4"].These values are the options<br>
   for dropdown menu.If user selected any of the values.The documents consisting value for key <em>name</em> should be displayed.</p>