Rails join two tables code example
Example 1: rails join table macro
create_join_table :posts, :tags
Example 2: rails how to use joins
User.joins(:groups).where(groups: {id: 1})
create_join_table :posts, :tags
User.joins(:groups).where(groups: {id: 1})