I made a selection helper.. I know, it''s ugly code so the others need
not comment :p
In my case it was States and Cities though. If you take some time to
understand the code you''ll be able to use it as well.
Please see the following in order:
1) http://railshacks.blogspot.com/2007/09/helper-collectionforselect.html
2) http://pastie.caboo.se/104642
In the pastie, you''ll see
1) state selection box in view --> this would be your "city"
2) encodeURI_selection helper --> just a helper that it uses
3) show_cities.rjs --> this would be your "show_companies.rjs"
action
4) city_select.rhtml --> this would be your "company_select.rjs"
Remember -- your city is to my state, your company is to my city.. so
don''t get confused :)
On 10/7/07, Igor K.
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> Hello, I have a 2 comboboxes on my web-page. first contains list of
> cities, and other contains list of companies. But i need to filter
> second combobox by selected city in first combo.
> What the best way to implement this.
> I know this is not hard task but i don''t what to invent wheel.
>
> Thanks
> --
> Posted via http://www.ruby-forum.com/.
--
Ramon Tayag
--~--~---------~--~----~------------~-------~--~----~
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
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---