Forum: Ruby on Rails return value from collection_select

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Victor F. (Guest)
on 2006-05-23 21:38
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

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

Thank you very much!

This topic is locked and can not be replied to.