Forum: Ruby on Rails return value from collection_select

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
15c43b9d84557e8547eea759ee3ba016?d=identicon&s=25 Victor Fan (victorfan)
on 2006-05-23 19: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
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
This topic is locked and can not be replied to.