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.
8b1314e1e15781e22f9bdef89117c752?d=identicon&s=25 Paul Finer (paulfiner)
on 2008-11-26 15: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!


8b1314e1e15781e22f9bdef89117c752?d=identicon&s=25 Paul Finer (paulfiner)
on 2008-11-28 16:28
Can anyone help me this?
10f7e00c1c5c60e2173995eb16f4ffc7?d=identicon&s=25 pepe (Guest)
on 2008-12-01 03:13
(Received via mailing list)
Have you heard of observe_field?


On Nov 28, 10:28 am, Paul Finer <>
This topic is locked and can not be replied to.