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