What is the difference between using `:references` and `:belongs_to` in a generate command in Rails?

What is the difference between using :references and :belongs_to in the following command?

bin/rails generate scaffold LineItem product:references cart:belongs_to

BTW it’s from the book Agile Web Development with Rails 7 (PragProg) by @rubys @pragdave.

Thank you!

1 Like