# Using more than 1 collection\_select drop down in a form

**URL:** <https://www.ruby-forum.com/t/using-more-than-1-collection-select-drop-down-in-a-form/110503>\
**Category:** Rails\
**Created:** [July 26, 2007, 10:26pm UTC](https://www.ruby-forum.com/t/using-more-than-1-collection-select-drop-down-in-a-form/110503 "2007-07-26T22:26:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanderkerkoff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/7feea3/32.png) [@vanderkerkoff](https://www.ruby-forum.com/u/vanderkerkoff)\
**Post date:** [July 26, 2007, 10:26pm UTC](https://www.ruby-forum.com/t/using-more-than-1-collection-select-drop-down-in-a-form/110503/1 "2007-07-26T22:26:17Z")

</div>

Bashing my head off this one, done some serious googling and can;t find  
an answer anywhere,

is there any way to run multiple collection selects in single form, i  
have 1 working no problems, but when I try to set up a second I just get  
the same values as the first one stored, I think I need an array of some  
sort? But how?

---

<div class="post-metadata">

**Author:** ![vanderkerkoff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/7feea3/32.png) [@vanderkerkoff](https://www.ruby-forum.com/u/vanderkerkoff)\
**Post date:** [July 26, 2007, 10:35pm UTC](https://www.ruby-forum.com/t/using-more-than-1-collection-select-drop-down-in-a-form/110503/2 "2007-07-26T22:35:30Z")

</div>

if you use the select helper twice for the same object, both resulting  
dropdowns will have the same name attribute, and therefore the value  
in the params hash of one select will be overwritten by the other.

you could create the select tag yourself, giving it a different name,  
and use options\_from\_collection\_for\_select to put the   
inside.

On 26 Jul., 22:26, Matt D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![vanderkerkoff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/7feea3/32.png) [@vanderkerkoff](https://www.ruby-forum.com/u/vanderkerkoff)\
**Post date:** [July 26, 2007, 10:40pm UTC](https://www.ruby-forum.com/t/using-more-than-1-collection-select-drop-down-in-a-form/110503/3 "2007-07-26T22:40:59Z")

</div>

Cheers for that, what I’m trying to do is create two records with a  
single subit, I have a model degree with a HABTM relationship with a  
model assigned, and what I want to be able to do is to create two  
assigneds on one form for a degree, so I think they need to have the  
same name, just not quite sure how to submit the data and then write it  
to seperate rows
