kris.vandenbe...@gmail.com wrote:
> I am really new to Ruby and Rails but as you probably see I am trying
> to get the shopping card working from the book. I am getting this
> error but I really don't know what to do. I have looked up several of
> topics that stated the same problem but as far as I am, nothing has
> helped me out yet. Is there something wrong with the Product model?
> 
> This is in the StoreController and I believe it is all good.
> 
>   def add_to_cart
>     @cart = find_cart
>     product = Product.find(params[:id])
>     @cart.add_product(product)
>   end
> 
> Thanks in advance

edit in cart_item.rb

// before
def initialize
 @product = product
 @quantity = 1
end

// after
def initialize(product)
  @product = product
  @quantity = 1
end
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to