What did we just do? Check out the diagram in the browser:
- We created three models -
- In the models, we used the
has_many :through association to connect the
Movie model to the
Actor model through the
In this way, the
has_many :through association sets up a many-to-many relationship between movies and actors.