Return value from collection_select


#1

Hi everyone

I am trying to get the return value from collection_select helper
method. Here is what I did

collection_select(‘product’, ‘product_id’, @products, ‘id’, ‘name’, {},
{:onchange => remote_function(:url => {:action => :myFunction},
:with => “this[this.selectedIndex].value”)})

then in my controller’s myFunction, I get the value using
request.raw_post

Is there a better way to do the same thing? should I use select instead
of collection_select?

Thank you very much!

Victor