activerecord associations code example
Example 1: rails join table macro
create_join_table :posts, :tags
Example 2: active record create association
@book = @author.books.create(published_at: Time.now)
create_join_table :posts, :tags
@book = @author.books.create(published_at: Time.now)