Forum: Ruby on Rails Contingent selects - AJAX style

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
JannaB (Guest)
on 2009-05-26 14:36
(Received via mailing list)
If I have an html.erb file, wherein one select box's selections
displayed are contingent upon the value chosen in another select box
(for example, if I have a state select box, contingent on the country
showm in the country select box, so that if I have United States
chosen as the country, and I switch to Canada, only the 12 provinces
of Canada should now be available in the state select box) how can I
accomodate that in an AJAX-manner? Below is the html.erb code I am
trying to get this into (note I am using the Carmen plugin) Thanks,
Janna B.

<p>
     <%= f.label :state %><br />
  <%= f.state_select :state %>
  </p>
  <p>
      <%= f.label :country %><br />
      <%= f.country_select :country, 'US' %>
   </p>
This topic is locked and can not be replied to.