It looks like in your source, line 39 of app/controllers/products.rb is:
@latest_order = @product.orders.order('updated at').last
The correct code should read:
@latest_order = @product.orders.order('updated_at').last
Note that the space in the string is replaced by an underscore.
To make this a bit less error prone in the future, I’m going to update the book to suggest the following instead:
@latest_order = @product.orders.order(:updated_at).last
|