Forum: Ruby on Rails Updating a select the correct way?

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.
1ba5028bed0c4e9faf842bc8f25835dc?d=identicon&s=25 Geoffrey Gallaway (Guest)
on 2006-04-15 01:32
(Received via mailing list)
I have two <select> objects. The first one (let's use the standard
example
of artists/albums here) is pre-loaded from the page but I want the
second
one to load when the user changes the value in the first form. Before
RoR I
would just do this with the onChange handler of the <select> object. The
onChange would fire off a javascript function that would use the results
of
a XMLHTTPRequst to reset the options for the target <select>.

In RoR the standard way seems to just be replace the entire field object
by
replacing the contents of a div (observe_field, etc). Is there any built
in
way to just replace the items in the select?

What am I missing?

Thanks,
Geoffeg
This topic is locked and can not be replied to.