Forum: Ruby on Rails NoMethodError in StoreController#add_to_cart

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6a4a143f995a141a17da9543e0ed2174?d=identicon&s=25 Frank Cheung (fcuk112)
on 2009-04-23 18:11
Working through the Agile Web Development w/ Rails book on p114.  I can
add single items of each to the cart but when I try to add a second item
I get the following error:

 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.+

Any idea why this is happening?  Thanks.

Frank.
This topic is locked and can not be replied to.