title: Rails Nested from plus join table
body: <p>I have the following models and running rails 3.01: </p>
  
  <pre><code># file: app/models/product.rb
  class Product &lt; ActiveRecord::Base
    has_many :categories, :through =&gt; :product_categories
    has_many :product_categories, :dependent =&gt; :destroy
    accept_nested_attributes_for :product_categories
  end
  
  # file: app/models/category.rb
  class Category &lt; ActiveRecord::Base
    has_many :products, :through =&gt; :product_categories
    has_many :product_categories, :dependent =&gt; :destroy
  end
  
  # file: app/models/product_category.rb
  class ProductCategory &lt; ActiveRecord::Base
    belongs_to :product
    belongs_to :category
  end
  </code></pre>
  
  <p>ProductCategory is my join table. What do I call in my products form? Do I build on the Categories table or the ProdcutCategories table? Im just really confused on how/which models Im supposed to nest in my products from. Thanks! </p>