You could have a look at acts_as_tree to build up a hierarchy of options
using a single model
wiki.rubyonrails.org/rails/pages/ActsAsTree
So you could have first options: A and B
and as children of A have: C and D
and as children of B have: E and F
You can scale this to as many levels as you like.
Cheers,
James
On 5/30/07, Anusha Naga vasavi
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
>
> how to create dynamic drop down using a single model...
> like one drop down list should have list of states which should be
> populated by taking the values from the database.... and depending on
> the selection of option in the first drop down list the values in the
> second(cities) drop down list should be populated taking the values from
> the database...
> it wud be grateful if any one can come forward and help me do dat ....
> i cud do that but using 2 models....
>
> --
> Posted via ruby-forum.com.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---