Select_tag problem


#1

Hi

I have a feeds db described like this:

| id | int(11) | NO | PRI | | auto_increment |
| url | varchar(255) | YES | | | |
| name | varchar(255) | YES | | | |
| type | varchar(255) | YES | | | |
| valid | int(11) | YES | | | |

In my feeds view i have :


URL
<%= text_field 'feed', 'url' %>

Name
<%= text_field 'feed', 'name' %>

Type
<%= select_tag 'feed[type]', options_for_select( { "Option1" => "opt1", "Option2" => "opt" }) %> ----

If the data is sent .save and update_attributes doesn’t save the type
field even though it’s sent correctly through the hash (it uses
select_tag):

Parameters: {“feed”=>{“name”=>“name”, “url”=>“http://url.com”,
“type”=>“opt1”}, “commit”=>“Edit”, “action”=>“update”, “id”=>“5”,
“controller”=>“feeds”}

This version however works:
@feed = Feed.find(params[:id])
@feed.type = params[:feed][:type]
if @feed.update_attributes(params[:feed])
[…]

Any ideas on how to fix the select_tag issue ?

Thanks