# \[ select\_tag and options\_for\_select \] posting problem

**URL:** <https://www.ruby-forum.com/t/select-tag-and-options-for-select-posting-problem/113008>\
**Category:** Rails\
**Created:** [August 26, 2007, 2:02am UTC](https://www.ruby-forum.com/t/select-tag-and-options-for-select-posting-problem/113008 "2007-08-26T02:02:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![argyre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@argyre](https://www.ruby-forum.com/u/argyre)\
**Post date:** [August 26, 2007, 2:02am UTC](https://www.ruby-forum.com/t/select-tag-and-options-for-select-posting-problem/113008/1 "2007-08-26T02:02:51Z")

</div>

Hello community!

Here is the problem:

I’m using select\_tag and options\_for\_select for the 50 U.S States to be  
sent to the database table called “properties”. But upon a new posting  
or editing a posting, it does not post to the database.

\<% form\_tag :propertiy, :url =\> properties\_url, :html =\> {:method =\>  
:put }%\>

State: \<%= select\_tag ("state[]" , options\_for\_select(['AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'])) %\>

Can someone please help?

---

<div class="post-metadata">

**Author:** ![argyre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@argyre](https://www.ruby-forum.com/u/argyre)\
**Post date:** [August 26, 2007, 2:17am UTC](https://www.ruby-forum.com/t/select-tag-and-options-for-select-posting-problem/113008/2 "2007-08-26T02:17:26Z")

</div>

Here is the whole “new.rhtml” so far:

## Create New Property

\<%= error\_messages\_for :property %\>

\<% form\_for :property, :url =\> property\_url(@property), :html =\> {  
:method =\> :put } do |f| -%\>

MLS Number: \<%= f.text\_field :mls\_number, :size =\> 5 %\>

House Number: \<%= f.text\_field :house\_number, :size =\> 5 %\>

Street Name: \<%= f.text\_field :street\_name, :size =\> 20 %\>

City: \<%= f.text\_field :city, :size =\> 20 %\>

 \<% form\_tag :property, :url =\> properties\_url, :html =\> {:method =\> :put } %\> 

State: \<%= select\_tag ("state[]" , options\_for\_select(['AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'])) %\>

Listing Agent Information

First \<%= f.text\_field :list\_agent\_first\_name, :size =\> 15 %\>

Last \<%= f.text\_field :list\_agent\_last\_name, :size =\> 15 %\>

Listing Company: \<%= f.text\_field :list\_office\_name, :size =\> 15 %\>

Bedrooms: \<%= f.text\_field :bedrooms, :size =\> 2 %\>

 \<%= submit\_tag 'Save' %\> or \<%= link\_to 'cancel', properties\_url %\> \<% end -%\>
