title: Dynamically-adjusting drop down fields on Active Admin form (rails 3.2)
body: <p>I have a very basic architecture on my Ruby on Rails app:</p>
  
  <ul>
  <li><p>a company model</p></li>
  <li><p>a Industry model (a company belongs to an industry)</p></li>
  <li><p>a Sub-industry model (a subindustry belongs to a Industry)</p></li>
  </ul>
  
  <p>On my active admin form page, I want to put fields so that for each company, I first select in a drop down the industry it belongs to (this works so far), and then another field "sub industry", that would ONLY display, according to the industry I selected in the previous field, the subindustries that I have categorized previously in this industry.</p>
  
  <p>For example, coca would go in industry "Drinks and beverage" and I'd like the form to dynamically adjust and only show in the field "sub indsutry" :a dropdown with "hot drinks", "cold drinks", "tea", "sodas"</p>
  
  <pre><code>form do |f|
  
      f.inputs "Company" do
  
        f.input :company_industry_id,    :label =&gt; "Select industry:",             :as =&gt; :select, :collection =&gt; CompanyIndustry.all
        f.input :company_subindfustry_id, :label =&gt; "Select subindustry:",  :as =&gt; :select, :collection =&gt; CompanySubindustry.all
  end
  </code></pre>
  
  <p>Obviously I have a problem as so far, it show me ALL the subindustries I have and not only the subindustries WITHIN the industry I select on the previous field.</p>
  
  <p>Does anyone know how I can solve that ?</p>