small medium large xlarge

26 Feb 2009, 01:30
michael chizzo (2 posts)

Chapter 8 Cart Creation: When doing the add_to_cart routine on p114, I get this error: ( I do not get the NoMethodError in StoreController#add_to_cart as described in book )

NameError in StoreController#add_to_cart

uninitialized constant Cart::CartItem RAILS_ROOT: /Users/foo/Documents/Development_Apps/Rails_Folder/depot

Application Trace | Framework Trace | Full Trace /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:493:in const_missing' app/models/cart.rb:22:in add_product’ app/controllers/store_controller.rb:17:in `add_to_cart’ Request


{“authenticity_token”=>”b9d9336846ed48ea923818fa7f038c143a62e775”, “id”=>”6”} Show session dump

:cart: !ruby/object:Cart items: []

flash: !map:ActionController::Flash::FlashHash {}



{“cookie”=>[], “Cache-Control”=>”no-cache”}

I have copied the book code twice now from depot_g, did the rake db:sessions:clear twice and even restarted app, and db, but I can’t get over this hurdle.

You must be logged in to comment