As far as I remember, has_and_belongs_to_many gives you a simple lookup table that references your two models.
For example,
Stories can belong to many categories. Categories can have many stories.
Categories_Stories Table story_id | category_id
has_many :through gives you a third model that can be used to store various other pieces of information that do not belong to any of the original models.
for example
A person can subscribe to many magazines. Magazines can have many subscribers.
Thus, we can have a subscription model in the middle, which gives us a similar table for an earlier example, but with additional properties.
Subscriptions Table person_id | magazine_id | subscription_type | subscription_length | subscription_date
And so on.
Dan May 6 '10 at 12:30 2010-05-06 12:30
source share