# Drop down in a form\_for action?

**URL:** <https://www.ruby-forum.com/t/drop-down-in-a-form-for-action/145849>\
**Category:** Rails\
**Created:** [August 14, 2008, 2:47pm UTC](https://www.ruby-forum.com/t/drop-down-in-a-form-for-action/145849 "2008-08-14T14:47:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CPerry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9d8465/32.png) [@CPerry](https://www.ruby-forum.com/u/CPerry)\
**Post date:** [August 14, 2008, 2:47pm UTC](https://www.ruby-forum.com/t/drop-down-in-a-form-for-action/145849/1 "2008-08-14T14:47:21Z")

</div>

Hey, I was just looking over the Rails API for form helpers here…

[http://api.rubyonrails.com/classes/ActionView/Helpers/FormHelper.html](http://api.rubyonrails.com/classes/ActionView/Helpers/FormHelper.html)

I noticed that there is no tag for a select/drop down menu?? I need to  
create two separate drop downs for my form, one that allows the user  
to choose a condition (new, excellent, good, fair) and one that allows  
them to choose the category that they want to place the item in  
(men’s, women’s, children’s, etc.). Can anyone point me in the right  
direction for creating a drop down for my form?

Here is my current generic form\_for code:

\<% form\_for @item do |f| %\>

title:  
\<%= f.text\_field :title %\>

color:  
\<%= f.text\_field :color %\>

brand:  
\<%= f.text\_field :brand %\>

description:  
\<%= f.text\_area :description %\>

\<%= submit\_tag %\> \<% end %\>

–Cory

---

<div class="post-metadata">

**Author:** ![CPerry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9d8465/32.png) [@CPerry](https://www.ruby-forum.com/u/CPerry)\
**Post date:** [August 14, 2008, 2:52pm UTC](https://www.ruby-forum.com/t/drop-down-in-a-form-for-action/145849/2 "2008-08-14T14:52:37Z")

</div>

This:

\<%= select :facilitator, :id, @facilitators.map{|u| [u.surname,u.id]}

> 

will create this:

jj

j

---

<div class="post-metadata">

**Author:** ![CPerry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9d8465/32.png) [@CPerry](https://www.ruby-forum.com/u/CPerry)\
**Post date:** [August 14, 2008, 3:42pm UTC](https://www.ruby-forum.com/t/drop-down-in-a-form-for-action/145849/3 "2008-08-14T15:42:30Z")

</div>

Also check out collection\_select in the Rails Framework doc  
([http://api.rubyonrails.org/](http://api.rubyonrails.org/))

collection\_select(:post, :author\_id, Author.find(:all), :id,  
:name\_with\_initial, {:prompt =\> true})
