Agile arguement error

Working my way through chapter 8 of “Agile Web D…”, I’m
getting the following error when clicking the add_to_cart button.

ArgumentError in Store#add_to_cart
wrong number of arguments (0 for 1)

What am I doing wrong? I know it’s got to be some thing stupid.

Parameters: {“id”=>“1”}

session dump:

:cart: !ruby/object:Cart
items: []
total_price: 0.0
flash: !ruby/hash:ActionController::Flash::FlashHash {}

and the method def:

def add_to_cart
product = Product.find(params[:id])
@cart = find_cart
redirect_to(:action => ‘display_cart’)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs