Top "Has-and-belongs-to-many" questions

A has_many :through association set up a many-to-many connection with another model.

Rails: is it possible to add extra attribute to a has_and_belongs_to_many association?

What I mean is if I have two models, connected by a has_and_belongs_to_many association, can I …

ruby-on-rails activerecord model has-and-belongs-to-many
Multiple select issue with a HABTM relationship using Rails 4

Although the code seems to be right, when I try to send the form, the values of the multiple select …

forms ruby-on-rails-4 has-and-belongs-to-many
Cake HABTM Query, Order By Rand()

I'm aware that Cake HABTM associations are tricky at the best of times, but I seem to be making life …

cakephp has-and-belongs-to-many
HABTM - uniqueness constraint

I have two models with a HABTM relationship - User and Role. user - has_and_belongs_to_many :roles …

ruby-on-rails has-and-belongs-to-many unique-constraint
Rails 4 many to many association not working

Ruby on rails newbie here. Trying to create a starter blog app and having trouble with many to many association …

ruby-on-rails ruby associations ruby-on-rails-4 has-and-belongs-to-many
Records in join table destroyed automatically in HABTM association?

Let's say I have an association where User has and belongs to many Roles. When I destroy the user, is …

ruby-on-rails join has-and-belongs-to-many destroy
How can I load HABTM-with-foreign-key relationships in my fixtures?

I have the following two models: School and User, and a HABTM relationship between them, with a join table. In …

ruby-on-rails foreign-keys fixtures has-and-belongs-to-many