title: ActiveAdmin has_many through relationship not updating param Rails
body: <p>I'm working through creating a has_many: through relationship in active admin.  Here are the models as they stand:</p>
  
  <pre><code> class Category &lt; ActiveRecord::Base
     has_many :subcategories
   end
  
   class Subcategory &lt; ActiveRecord::Base
     has_many :product_in_subcategories
     has_many :products, through: :product_in_subcategories
     accepts_nested_attributes_for :product_in_subcategories, :allow_destroy =&gt; true
  
     belongs_to :category
   end
  
   class Product &lt; ActiveRecord::Base
     has_many :product_in_subcategories
     has_many :subcategories, through: :product_in_subcategories
     accepts_nested_attributes_for :product_in_subcategories, :allow_destroy =&gt; true
   end
  
   class ProductInSubcategory &lt; ActiveRecord::Base
     belongs_to :product
     belongs_to :subcategory
   end
  </code></pre>
  
  <p>In ActiveAdmin I have the permit_params and form like so:</p>
  
  <pre><code> ActiveAdmin.register Product do
     # note some params that are product only have been removed for simplicity
     permit_params :name, subcategory_id:[:id], product_in_subcategories_attributes: [:id, :subcategory_id, :product_id, :_create, :_update]
  
       form do |f|
         f.inputs
  
        f.has_many :product_in_subcategories do |s|
            s.input :subcategory_id, :as =&gt; :check_boxes, :collection =&gt; Subcategory.all
        end
  
        f.actions
      end
  end
  </code></pre>
  
  <p>The form populates as should, and will save everything except for the subcategory_id.  If I enter into the DB a proper subcategory_id the box will show checked on edit.  </p>
  
  <p>The messages when saving give:</p>
  
  <pre><code> Unpermitted parameters: subcategory_id
  </code></pre>
  
  <p>However, it appears it is trying to submit this with the product, for which there isn't a subcategory_id.  Any ideas on what I am doing incorrectly here?  This is driving me nuts and I've read everything I can find.  I'd really like to understand what I'm doing wrong.  Thanks.</p>