Dear all
I want to create two select_tag in view, the second select_tag will
depend on the first select_tag values.
i.e. If the first select_tag selected AHN, then the second have value
[CPS,HMS,MBS,BBS] for selection. If the first select_tag selected NDH,
only [ABS,CPS] is available in second select_tag. I have no idea how to
implement this. Please give me some advices. Thank you.
tables
column_1 column_2
AHN CPS
AHN HMS
AHN MBS
AHN BBS
NDH ABS
NDH CPS
PWH CPS
PWH MBS
PWH CRS
enquiries controller
@column_1= Table.find(:all).collect {|x| [x.column_1, x.column_1]}.uniq
view/enquiries
<% form_tag do %>
<%= select_tag(:column_1, options_for_select(@column_1)) %>
<%= select_tag(:column_2, #How to do here?) %>
<%= submit_tag "search" %>
<% end %>
Many thanks
Valentino
--
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-/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
-~----------~----~----~----~------~----~------~--~---