Join table for has_many through in Rails
问题 I am new to programming & rails and there's something I dont fully understand. I am creating an app with product has_many categories category has_many products If I understand correctly I need to create a join table products_categories which has a product_id & a category_id . First do I also need a model for this table ? if yes I guess it would look like this : class CategoryProduct < ActiveRecord::Base belongs_to :category belongs_to :product end and the other models in product.rb : class