# Select\_tag in form\_for?

**URL:** <https://www.ruby-forum.com/t/select-tag-in-form-for/129408>\
**Category:** Rails\
**Created:** [February 18, 2008, 11:20am UTC](https://www.ruby-forum.com/t/select-tag-in-form-for/129408 "2008-02-18T11:20:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@peter](https://www.ruby-forum.com/u/peter)\
**Post date:** [February 18, 2008, 11:20am UTC](https://www.ruby-forum.com/t/select-tag-in-form-for/129408/1 "2008-02-18T11:20:35Z")

</div>

How can i use a select\_tag correctly inside a form\_for block? when i  
do a f.select\_tag i get the error that select\_tag is not available for  
the formbuilder-object. is it possible to create a select tag inside  
this context? i’d like to have the name the same as the other input-  
fields in the form, so i can use the form-data with 1 create/  
params[:data] line

---

<div class="post-metadata">

**Author:** ![peter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@peter](https://www.ruby-forum.com/u/peter)\
**Post date:** [February 18, 2008, 11:41am UTC](https://www.ruby-forum.com/t/select-tag-in-form-for/129408/2 "2008-02-18T11:41:40Z")

</div>

Hi Peter,  
Use this select tag \<%= select(:rule, :condition, @rules) %\> within  
form  
tag…

Here :rule indicate the table name and condition indicate the field  
name…@rules used to retrieve the fields from table…It is useful for  
both  
creating and editing operations.

Regards,

Babysudha.
