title: How can I show only the prefecture that belongs to selected country?
body: <p>I'd like to implement automatic selections of prefectures depending on the country that user choose.<br>
  I mean, it shows California, New York, and etc in prefecture select if user choose U.S.  </p>
  
  <p><strong>Country</strong> model has</p>
  
  <ul>
  <li>id</li>
  <li>name</li>
  </ul>
  
  <p><strong>Prefecture</strong> model has</p>
  
  <ul>
  <li>id</li>
  <li>country_id</li>
  <li>prefecture</li>
  </ul>
  
  <p>Now I'm showing these field like this</p>
  
  <pre><code>&lt;% resource.build_user_profile if resource.user_profile.nil? %&gt;
  &lt;%= form_for(resource, :as =&gt; resource_name, :url =&gt; registration_path(resource_name), :html =&gt; { :method =&gt; :put, :class =&gt; 'form-horizontal' }) do |f| %&gt;
    &lt;%= devise_error_messages! %&gt;
  
  &lt;%= f.fields_for :user_profile do |profile_form| %&gt;
  
   &lt;label class="control-label"&gt;&lt;%= profile_form.label :country_id %&gt;&lt;/label&gt;
   &lt;%= profile_form.collection_select("country_id", Country.find(:all), :id, :name_en) %&gt;
  
   &lt;label class="control-label"&gt;&lt;%= profile_form.label :prefecture_id %&gt;&lt;/label&gt;
   &lt;%= profile_form.collection_select("prefecture_id", Prefecture.find(:all), :id, :name) %&gt;
  
  &lt;% end %&gt;
  </code></pre>