You can use .uniq! on any array (which includes ActiveRecord.find(:all...)
return values).
In terms of setting the other combo boxes you''ll either need to ajax
back to
the controller or pass all data in the first time and have javascript do
some filtering for you (which you choose depends on how much data you have).
My computer at home has something like this already coded. I''ll try to
remember to put it up on github tonight or tomorrow.
On Tue, Feb 16, 2010 at 10:14 PM, Veena Jose
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
> plz help me in retrieving distinct element from db and populate in
> combobox?
>
> I hav created a model "location".It has elements
> (state,district,province,...)
> I want to populate one combobox with distinct state and the other combo
> box should display corresponding districts in that state which is
> selected.
>
> Can you give me the code for view, and controller
> --
> Posted via http://www.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.