Forum: Ruby on Rails Populate a popup menu based on another menu selection

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.
Paul F. (Guest)
on 2008-11-26 16:39
I'm just getting started with RoR and need some help with setting up the
following scenario.

I have three models:- Jobs, Clients and Contacts

A job has one Client which, in turn, has many contacts.

When I'm creating a new job I would like a popup menu so the user can
choose the client.
Having done this, I would then like another popup menu to only show the
for the client selected.

I have the first popup done using:-

<%= select("client","client_id", Client.find(:all).collect {|c| [,]}) %>

I'm stuck on how I would populate the contacts menu based on the client

Any help would be much appreciated!


Paul F. (Guest)
on 2008-11-28 17:28
Can anyone help me this?
pepe (Guest)
on 2008-12-01 04:13
(Received via mailing list)
Have you heard of observe_field?


On Nov 28, 10:28 am, Paul F. <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.