How to create a many-to-many ActiveRecord association in Ruby on Rails

In this article I’ll go through the creation of a many-to-many relationship with the built-in Ruby on Rails ActiveRecord associations,has_many :through and has_and_belongs_to_many:. Additionally, the specific differences between the two will be examined, but before all that let’s first get some background on what is a many-to-many relationship.


One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.