Forum: Ruby on Rails Calling a remote method on choosing an item from 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.
Sandeep G. (Guest)
on 2009-01-19 17:23
Hi,

Is there a way where in I can trigger remote action when an user choose
one of the options in the dropdown of "select" method?

Mebbe something like on_change but instead of triggering JS action,
remote action is what i am looking at.

Please suggest


Regards,
Sandeep
Frederick C. (Guest)
on 2009-01-19 18:47
(Received via mailing list)
On 19 Jan 2009, at 15:23, Sandeep G. wrote:

> Please suggest
>
onchange is what you want. the javascript in there should make an ajax
request.

Fred
Sandeep G. (Guest)
on 2009-01-19 21:29
Thanks Fred.
I used something like this:
{:onchange => 'window.location=this.value;'}
the value of the select option can be made text link. So it worked like
a charm for me to load a new page on selecting an option.
This topic is locked and can not be replied to.