0

I have a has_and_belongs_to_many relationship, how do I create the migration to create the join table?

Blankman
  • 259,732
  • 324
  • 769
  • 1,199

1 Answers1

2
create_table :articles_tags, :id => false do |t|
  t.references :article, :tag
end

Taken from answer: Do I need to manually create a migration for a HABTM join table?

Community
  • 1
  • 1
Mailo Světel
  • 24,002
  • 5
  • 30
  • 40