Forum: Ruby on Rails Re: Agile arguement error

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.
Kirk Israel (Guest)
on 2006-01-30 07:05
(Received via mailing list)
Hi, yet another n00b working through the Agile book

Previously ted scharff wrote about a "ArgumentError in Store#add_to_cart
    wrong number of arguments (0 for 1)"

I got the same argument, I think by not putting the (product) in the
add_product function in class Cart.

Now, probably through some similar typo, I'm getting a

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.+

#{RAILS_ROOT}/app/models/cart.rb:12:in `add_product'
#{RAILS_ROOT}/app/controllers/store_controller.rb:10:in `add_to_cart'

I probably just need to go to bed and look at this tomorrow, but if
someone can use their telepathy and see what I'm doing wrong I
wouldn't mind hearing about it...
I've been comparing the source I mostly typed in by hand w/ what the
book shows, but don't even know enough about Ruby/Rails at this point
to even do the equivalent of Java System.out.println() and see what's
nil that shouldn't be....
This topic is locked and can not be replied to.