active record create association code example Example: active record create association @book = @author.books.create(published_at: Time.now)