RailsCasts Pro episodes are now free!

Learn more or hide this

nudler's Profile

GitHub User: nudler

Comments by

Avatar

I had a problem. When I changed the "country" dropdown sometimes it selected the wrong values for the "province" dropdown. Solved it like this:

ruby
country = $('#cat_category_id :selected').text()
province = $(countrydropdown).filter("optgroup[label='#{country}']").html()