nil can't be coerced into BigDecimal

PS. Why are you writing product.price=?

i belive it is same with product.price * quantity to show the sum of all products inside my cart

Logic, logic, logic.

product - is a stand alone instance or One product. Why Would it ever have the multiplied price with 'quantity' ?.

I remember many years ago I read the beginner's book "Agile Web Development with Rails", is that example from it? I think you missed something.

thank very much for the effort yes this is from the book agile web development with rails sorry about it im just starting to learn ruby on rails

PS. Why are you writing product.price=?

i belive it is same with product.price * quantity to show the sum of all products inside my cart

Logic, logic, logic.

product - is a stand alone instance or One product. Why Would it ever have the multiplied price with 'quantity' ?.

I remember many years ago I read the beginner's book "Agile Web Development with Rails", is that example from it? I think you missed something.

thank very much for the effort yes this is from the book agile web development with rails sorry about it im just starting to learn ruby on rails, uhm i didnt miss anything its just other snippets in the book is not properly working :frowning: