I have been fine through the book until Chapter 8, but this is where I am starting to get problems. I am running the latest stable version of Rails, Ruby, and pretty much everything related to it… and I get the following error when trying to run my cart “script”.
NoMethodError in StoreController#add_to_cart
You have a nil object when you didn’t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.«
I have learned that it is some problem with “@cart.add_product(product)” as when I comment out this line it works.
Any help would be great.
EDIT: Never mind, I figured it out.