title: Get selected item from dropdown menu via ruby
body: <p>My problem is that I have a form that like:</p>
  
  <pre><code>&lt;select name="Users"&gt;
    &lt;option value=""selected&gt;Select user to add&lt;/option&gt;
    &lt;% notShareWith.each do |user| %&gt;
      &lt;option value=&lt;%user.id%&gt;&gt;&lt;%=user.name+" "+user.email%&gt;&lt;/option&gt;
    &lt;% end %&gt;
  &lt;/select&gt;
  &lt;% form_for @imageuser do |f| %&gt;
    &lt;%= f.hidden_field :user_id ,:value =&gt; 5 %&gt;
    &lt;%= f.hidden_field :image_id ,:value =&gt; @image.id %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>My drop down menu works fine and it list the users that have access. I can revoke access and everything. I have no clue how to know what option is selected from the drop down menu or how to submit that to the image users form. I am using:</p>
  
  <pre><code>&lt;% form_for @imageuser do |f| %&gt;
    &lt;%= f.hidden_field :user_id ,:value =&gt; 5 %&gt;
    &lt;%= f.hidden_field :image_id ,:value =&gt; @image.id %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>to submit the user that is selected but I need to know what the value of the selected item is so I can pass said value into:</p>
  
  <pre><code>&lt;%= f.hidden_field :user_id ,:value =&gt; 5 %&gt;
  </code></pre>
  
  <p>Thanks again for the help.</p>