# Trouble using drop down box

**URL:** <https://www.ruby-forum.com/t/trouble-using-drop-down-box/119353>\
**Category:** Rails\
**Created:** [November 6, 2007, 11:24am UTC](https://www.ruby-forum.com/t/trouble-using-drop-down-box/119353 "2007-11-06T11:24:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![subhash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/47e85d/32.png) [@subhash](https://www.ruby-forum.com/u/subhash)\
**Post date:** [November 6, 2007, 11:24am UTC](https://www.ruby-forum.com/t/trouble-using-drop-down-box/119353/1 "2007-11-06T11:24:40Z")

</div>

I am using a drop down box in a form, the method is GET. The data  
that  
i am selecting in the box is not getting stored in the database. But  
when i am not using the drop down box the rest of the data is getting  
stored. I stored the submitted form data in an instance variable.  
When  
i am trying to print the instance variable no output is coming…  
Can anybody tell how to get the selected data in the drop down box in  
the other form?

---

<div class="post-metadata">

**Author:** ![subhash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/47e85d/32.png) [@subhash](https://www.ruby-forum.com/u/subhash)\
**Post date:** [November 6, 2007, 12:13pm UTC](https://www.ruby-forum.com/t/trouble-using-drop-down-box/119353/2 "2007-11-06T12:13:16Z")

</div>

On 6 Nov 2007, at 10:23, Subhash wrote:

> I am using a drop down box in a form, the method is GET. The data  
> that  
> i am selecting in the box is not getting stored in the database. But  
> when i am not using the drop down box the rest of the data is getting  
> stored. I stored the submitted form data in an instance variable.  
> When  
> i am trying to print the instance variable no output is coming…  
> Can anybody tell how to get the selected data in the drop down box in  
> the other form?

People can’t help you if you don’t show them what you are doing.

Fred

---

<div class="post-metadata">

**Author:** ![subhash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/47e85d/32.png) [@subhash](https://www.ruby-forum.com/u/subhash)\
**Post date:** [November 6, 2007, 3:16pm UTC](https://www.ruby-forum.com/t/trouble-using-drop-down-box/119353/3 "2007-11-06T15:16:00Z")

</div>

Are you doing it like this  
\<%= collection\_select(:product, :Product\_ID,  
Product.find(:all), :id, :Product\_Name) %\>

OR check this post

> **[Not binding your selection list to a particular model in Rails](https://nasir.wordpress.com/2007/11/02/not-binding-your-selection-list-to-a-particular-model-in-rails/)**
>
> In Rails, we use collection\_select helper to display values from a particular model using a drop down but it is generally tied to a particular model, i.e. if we look at the generated html then we s…
