Dropdown select

hi
i am new to ruby,i have a problem with drop down list where i can select
an item and the selected item should be save in the database. But when i
select the item its option values is saving in the database. please help
here is the code:

category

<%= select_tag ‘category’, options_for_select([[‘3MONTHS’, 0],
[‘6MONTHS’, 1],[‘9MONTHS’, 2], [‘12MONTHS’, 3]], 0), :onchange =>
“content.category(this,notnull );” %>

And in controller i have write like this:
def create
@content = Content.new(params[:content])
@content.category= @params[:category].to_s
if @content.save
flash[:notice] = ‘Content was successfully created.’
redirect_to :action => ‘list’
else
render :action => ‘new’
end
end

Dilip Bv wrote:

hi
i am new to ruby,i have a problem with drop down list where i can select
an item and the selected item should be save in the database. But when i
select the item its option values is saving in the database. please help
here is the code:

category

<%= select_tag ‘category’, options_for_select([[‘3MONTHS’, 0],
[‘6MONTHS’, 1],[‘9MONTHS’, 2], [‘12MONTHS’, 3]], 0), :onchange =>
“content.category(this,notnull );” %>

del all the option values.
…options_for_select([‘3MONTHS’,‘6MONTHS’, ‘9MONTHS’,‘12MONTHS’])…