Add items to select_tag?


#1

Hi,

I have been struggling with the select tag for the last two days. Does
anyone know how to change the content of a select_tag? More
specifically, I have a list of items on another select_tag. I would
like to make it so that the user can add the items into their own list.
I tried this in my controller (with KRJS plugins)

def on_item_list_dblclick
render :update do |page|
page[‘user_list’].add = params[:dom_value]
end
end

Changing text in a textbox is simple, but I can’t find any documentation
about how to add to a select list. Any help would be appreciated.
Thank you.


#2

It seems like page[‘user_list’].add takes two arguments, both of which
should be DOM element object. How do I create DOM element object in
controller?