Your Pragmatic Cart
- 1 × Pragmatic Project Automation
8.4 Iteration C3: Handling Errors 8.2 Iteration C1: Creating a Cart
edit app/models/cart_item.rb
class CartItem
attr_reader :product, :quantity
def initialize(product)
@product = product
@quantity = 1
end
def increment_quantity
@quantity += 1
end
def title
@product.title
end
def price
@product.price * @quantity
end
end
edit app/models/cart.rb
def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
current_item.increment_quantity
else
@items << CartItem.new(product)
end
end
edit app/views/store/add_to_cart.html.erb
<h2>Your Pragmatic Cart</h2>
<ul>
<% for item in @cart.items %>
<li><%= item.quantity %> × <%= item.title %></li>
<% end %>
</ul>
get /store/add_to_cart/2
undefined method `product' for #<Product:0x7f418484c188>
Rails.root: /home/rubys/git/awdwr/edition3/work-30/depot
app/models/cart.rb:10:in `add_product'
app/models/cart.rb:10:in `each'
app/models/cart.rb:10:in `find'
app/models/cart.rb:10:in `add_product'
app/controllers/store_controller.rb:11:in `add_to_cart'
/home/rubys/git/rails/activemodel/lib/active_model/attribute_methods.rb:392:in `method_missing'
/home/rubys/git/rails/activerecord/lib/active_record/attribute_methods.rb:46:in `method_missing'
/home/rubys/git/rails/activerecord/lib/active_record/attribute_methods.rb:44:in `send'
/home/rubys/git/rails/activerecord/lib/active_record/attribute_methods.rb:44:in `method_missing'
/home/rubys/git/rails/activemodel/lib/active_model/attribute_methods.rb:97:in `find'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:150:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:436:in `_run__1297800236__process_action__746879535__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:119:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:41:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:138:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:178:in `action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:33:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:499:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.5) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:182:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.5) lib/rack/sendfile.rb:106:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.5) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `synchronize'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `send'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.5) lib/rack/content_length.rb:13:in `call'
rack (1.2.5) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.5) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.5) lib/rack/server.rb:217:in `start'
/home/rubys/git/rails/railties/lib/rails/commands/server.rb:65:in `start'
/home/rubys/git/rails/railties/lib/rails/commands.rb:30
/home/rubys/git/rails/railties/lib/rails/commands.rb:27:in `tap'
/home/rubys/git/rails/railties/lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
/home/rubys/git/rails/activemodel/lib/active_model/attribute_methods.rb:392:in `method_missing'
/home/rubys/git/rails/activerecord/lib/active_record/attribute_methods.rb:46:in `method_missing'
/home/rubys/git/rails/activerecord/lib/active_record/attribute_methods.rb:44:in `send'
/home/rubys/git/rails/activerecord/lib/active_record/attribute_methods.rb:44:in `method_missing'
app/models/cart.rb:10:in `add_product'
/home/rubys/git/rails/activemodel/lib/active_model/attribute_methods.rb:97:in `find'
app/models/cart.rb:10:in `each'
app/models/cart.rb:10:in `find'
app/models/cart.rb:10:in `add_product'
app/controllers/store_controller.rb:11:in `add_to_cart'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:150:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:436:in `_run__1297800236__process_action__746879535__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:119:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:41:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:138:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:178:in `action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:33:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:499:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.5) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:182:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.5) lib/rack/sendfile.rb:106:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.5) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `synchronize'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `send'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.5) lib/rack/content_length.rb:13:in `call'
rack (1.2.5) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.5) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.5) lib/rack/server.rb:217:in `start'
/home/rubys/git/rails/railties/lib/rails/commands/server.rb:65:in `start'
/home/rubys/git/rails/railties/lib/rails/commands.rb:30
/home/rubys/git/rails/railties/lib/rails/commands.rb:27:in `tap'
/home/rubys/git/rails/railties/lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
Parameters:
{"id"=>"2"}
cart: #<Cart:0x7f418484c250 @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846f93f8,'0.2995E2',18(18)>>, #<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846f84d0,'0.285E2',18(18)>>]>
GATEWAY_INTERFACE: "CGI/1.1" HTTP_ACCEPT: "text/html" HTTP_COOKIE: "_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly" HTTP_HOST: "localhost:3000" HTTP_VERSION: "HTTP/1.1" PATH_INFO: "/store/add_to_cart/2" QUERY_STRING: "" REMOTE_ADDR: "127.0.0.1" REMOTE_HOST: "localhost" REQUEST_METHOD: "GET" REQUEST_PATH: "/" REQUEST_URI: "http://localhost:3000/store/add_to_cart/2" SCRIPT_NAME: "" SERVER_NAME: "localhost" SERVER_PORT: "3000" SERVER_PROTOCOL: "HTTP/1.1" SERVER_SOFTWARE: "WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)" action_controller.instance: #<StoreController:0x7f41847fd6c8 @cart=#<Cart:0x7f418484c250 @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846f5ed8,'0.2995E2',18(18)>>, #<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846f55a0,'0.285E2',18(18)>>]>, @view_context_class=nil, @action_has_layout=true, @_action_name="add_to_cart", @_env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 1, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2012-06-29 19:12:06", updated_at: "2012-06-29 19:12:06">, "rack.session"=>{"cart"=>#<Cart:0x7f418484c250 @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846f3ae8,'0.2995E2',18(18)>>, #<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846f31b0,'0.285E2',18(18)>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f41848996e0 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/2", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :controller=>"store", :id=>"2"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/store/add_to_cart/2", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<StoreController:0x7f41847fd6c8 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f418489a608>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @_params={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @_config=#<OrderedHash {}>, @_response=#<ActionDispatch::Response:0x7f41847fd538 @cookie=[], @header={}, @status=200, @request=#<ActionDispatch::Request:0x7f41847fd600 @request_method="GET", @method="GET", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 1, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2012-06-29 19:12:06", updated_at: "2012-06-29 19:12:06">, "rack.session"=>{"cart"=>#<Cart:0x7f418484c250 @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846f0910,'0.2995E2',18(18)>>, #<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846effd8,'0.285E2',18(18)>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f41848996e0 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/2", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :controller=>"store", :id=>"2"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/store/add_to_cart/2", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<StoreController:0x7f41847fd6c8 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f418489a608>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @filtered_parameters={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @fullpath="/store/add_to_cart/2">, @body=[], @length=0, @etag=nil, @block=nil, @writer=#<Proc:0x00007f41861f8fa0@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @blank=false, @sending_file=false, @cache_control={}>, @_status=200, @_response_body=nil, @_request=#<ActionDispatch::Request:0x7f41847fd600 @request_method="GET", @method="GET", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 1, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2012-06-29 19:12:06", updated_at: "2012-06-29 19:12:06">, "rack.session"=>{"cart"=>#<Cart:0x7f418484c250 @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846ed698,'0.2995E2',18(18)>>, #<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846ecd60,'0.285E2',18(18)>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f41848996e0 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/2", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :controller=>"store", :id=>"2"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/store/add_to_cart/2", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<StoreController:0x7f41847fd6c8 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f418489a608>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @filtered_parameters={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @fullpath="/store/add_to_cart/2">, @lookup_context=#<ActionView::LookupContext:0x7f41847fd1c8 @view_paths=[#<ActionView::FileSystemResolver:0x7f41849fecd8 @caching=false, @cached={}, @path="/home/rubys/git/awdwr/edition3/work-30/depot/app/views">], @details_key=nil, @skip_default_locale=false, @details={:handlers=>[:rxml, :builder, :rjs, :erb, :rhtml], :formats=>[:html], :locale=>[:en, :en]}, @frozen_formats=false>, @_headers={"Content-Type"=>"text/html"}> action_dispatch.parameter_filter: [:password] action_dispatch.remote_ip: #<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f41848996e0 @check_ip_spoofing=true, @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 1, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2012-06-29 19:12:06", updated_at: "2012-06-29 19:12:06">, "rack.session"=>{"cart"=>#<Cart:0x7f418484c250 @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846ea128,'0.2995E2',18(18)>>, #<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846e97f0,'0.285E2',18(18)>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f41848996e0 ...>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/2", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :controller=>"store", :id=>"2"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/store/add_to_cart/2", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<StoreController:0x7f41847fd6c8 @cart=#<Cart:0x7f418484c250 @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846e8170,'0.2995E2',18(18)>>, #<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846e7838,'0.285E2',18(18)>>]>, @view_context_class=nil, @action_has_layout=true, @_action_name="add_to_cart", @_env={...}, @_params={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @_config=#<OrderedHash {}>, @_response=#<ActionDispatch::Response:0x7f41847fd538 @cookie=[], @header={}, @status=200, @request=#<ActionDispatch::Request:0x7f41847fd600 @request_method="GET", @method="GET", @env={...}, @filtered_parameters={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @fullpath="/store/add_to_cart/2">, @body=[], @length=0, @etag=nil, @block=nil, @writer=#<Proc:0x00007f41861f8fa0@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @blank=false, @sending_file=false, @cache_control={}>, @_status=200, @_response_body=nil, @_request=#<ActionDispatch::Request:0x7f41847fd600 @request_method="GET", @method="GET", @env={...}, @filtered_parameters={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @fullpath="/store/add_to_cart/2">, @lookup_context=#<ActionView::LookupContext:0x7f41847fd1c8 @view_paths=[#<ActionView::FileSystemResolver:0x7f41849fecd8 @caching=false, @cached={}, @path="/home/rubys/git/awdwr/edition3/work-30/depot/app/views">], @details_key=nil, @skip_default_locale=false, @details={:handlers=>[:rxml, :builder, :rjs, :erb, :rhtml], :formats=>[:html], :locale=>[:en, :en]}, @frozen_formats=false>, @_headers={"Content-Type"=>"text/html"}>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f418489a608>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i> action_dispatch.request.accepts: [#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">] action_dispatch.request.content_type: nil action_dispatch.request.formats: [#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">] action_dispatch.request.parameters: {"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"} action_dispatch.request.path_parameters: {:action=>"add_to_cart", :controller=>"store", :id=>"2"} action_dispatch.request.query_parameters: {} action_dispatch.request.request_parameters: {} action_dispatch.secret_token: "7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc" action_dispatch.show_exceptions: true rack.errors: #<IO:0x7f418a4a5ab0> rack.input: #<StringIO:0x7f418489a608> rack.multiprocess: false rack.multithread: false rack.request.cookie_hash: {"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"} rack.request.cookie_string: "_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly" rack.request.query_hash: {} rack.request.query_string: "" rack.run_once: false rack.session: {"cart"=>#<Cart:0x7f418484c250 @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846e53a8,'0.2995E2',18(18)>>, #<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846e4a70,'0.285E2',18(18)>>]>} rack.session.options: {:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil} rack.session.record: #<ActiveRecord::SessionStore::Session id: 1, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2012-06-29 19:12:06", updated_at: "2012-06-29 19:12:06"> rack.url_scheme: "http" rack.version: [1, 1]
Headers:
None
rake db:sessions:clear
get /store/add_to_cart/2
get /store/add_to_cart/2
get /store/add_to_cart/3
get /store/add_to_cart/wibble
Couldn't find Product with ID=wibble
Rails.root: /home/rubys/git/awdwr/edition3/work-30/depot
app/controllers/store_controller.rb:9:in `add_to_cart'
/home/rubys/git/rails/activerecord/lib/active_record/relation/finder_methods.rb:306:in `find_one'
/home/rubys/git/rails/activerecord/lib/active_record/relation/finder_methods.rb:291:in `find_with_ids'
/home/rubys/git/rails/activerecord/lib/active_record/relation/finder_methods.rb:107:in `find'
/home/rubys/git/rails/activerecord/lib/active_record/base.rb:444:in `__send__'
/home/rubys/git/rails/activerecord/lib/active_record/base.rb:444:in `find'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:150:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:436:in `_run__1297800236__process_action__746879535__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:119:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:41:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:138:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:178:in `action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:33:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:499:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.5) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:182:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.5) lib/rack/sendfile.rb:106:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.5) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `synchronize'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `send'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.5) lib/rack/content_length.rb:13:in `call'
rack (1.2.5) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.5) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.5) lib/rack/server.rb:217:in `start'
/home/rubys/git/rails/railties/lib/rails/commands/server.rb:65:in `start'
/home/rubys/git/rails/railties/lib/rails/commands.rb:30
/home/rubys/git/rails/railties/lib/rails/commands.rb:27:in `tap'
/home/rubys/git/rails/railties/lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
/home/rubys/git/rails/activerecord/lib/active_record/relation/finder_methods.rb:306:in `find_one'
/home/rubys/git/rails/activerecord/lib/active_record/relation/finder_methods.rb:291:in `find_with_ids'
/home/rubys/git/rails/activerecord/lib/active_record/relation/finder_methods.rb:107:in `find'
/home/rubys/git/rails/activerecord/lib/active_record/base.rb:444:in `__send__'
/home/rubys/git/rails/activerecord/lib/active_record/base.rb:444:in `find'
app/controllers/store_controller.rb:9:in `add_to_cart'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:150:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:436:in `_run__1297800236__process_action__746879535__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:119:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:41:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:138:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:178:in `action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:33:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:499:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.5) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:182:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.5) lib/rack/sendfile.rb:106:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.5) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `synchronize'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `send'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.5) lib/rack/content_length.rb:13:in `call'
rack (1.2.5) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.5) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.5) lib/rack/server.rb:217:in `start'
/home/rubys/git/rails/railties/lib/rails/commands/server.rb:65:in `start'
/home/rubys/git/rails/railties/lib/rails/commands.rb:30
/home/rubys/git/rails/railties/lib/rails/commands.rb:27:in `tap'
/home/rubys/git/rails/railties/lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
Parameters:
{"id"=>"wibble"}
cart: #<Cart:0x7f4184812d70 @items=[#<CartItem:0x7f4184812ca8 @quantity=2, @product=#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846b0608,'0.2995E2',18(18)>>>, #<CartItem:0x7f4184812668 @quantity=1, @product=#<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846af640,'0.285E2',18(18)>>>]>
GATEWAY_INTERFACE: "CGI/1.1" HTTP_ACCEPT: "text/html" HTTP_COOKIE: "_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly" HTTP_HOST: "localhost:3000" HTTP_VERSION: "HTTP/1.1" PATH_INFO: "/store/add_to_cart/wibble" QUERY_STRING: "" REMOTE_ADDR: "127.0.0.1" REMOTE_HOST: "localhost" REQUEST_METHOD: "GET" REQUEST_PATH: "/" REQUEST_URI: "http://localhost:3000/store/add_to_cart/wibble" SCRIPT_NAME: "" SERVER_NAME: "localhost" SERVER_PORT: "3000" SERVER_PROTOCOL: "HTTP/1.1" SERVER_SOFTWARE: "WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)" action_controller.instance: #<StoreController:0x7f41847ad920 @view_context_class=nil, @action_has_layout=true, @_action_name="add_to_cart", @_env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 2, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2012-06-29 19:12:11", updated_at: "2012-06-29 19:12:12">, "rack.session"=>{"cart"=>#<Cart:0x7f4184812d70 @items=[#<CartItem:0x7f4184812ca8 @quantity=2, @product=#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846abc98,'0.2995E2',18(18)>>>, #<CartItem:0x7f4184812668 @quantity=1, @product=#<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846ab270,'0.285E2',18(18)>>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f418487c4f0 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/wibble", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :controller=>"store", :id=>"wibble"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/store/add_to_cart/wibble", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<StoreController:0x7f41847ad920 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f418487d440>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @_params={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @_config=#<OrderedHash {}>, @_response=#<ActionDispatch::Response:0x7f41847ad510 @cookie=[], @header={}, @status=200, @request=#<ActionDispatch::Request:0x7f41847ad7b8 @request_method="GET", @method="GET", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 2, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2012-06-29 19:12:11", updated_at: "2012-06-29 19:12:12">, "rack.session"=>{"cart"=>#<Cart:0x7f4184812d70 @items=[#<CartItem:0x7f4184812ca8 @quantity=2, @product=#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846a8160,'0.2995E2',18(18)>>>, #<CartItem:0x7f4184812668 @quantity=1, @product=#<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846a7760,'0.285E2',18(18)>>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f418487c4f0 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/wibble", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :controller=>"store", :id=>"wibble"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/store/add_to_cart/wibble", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<StoreController:0x7f41847ad920 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f418487d440>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @filtered_parameters={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @fullpath="/store/add_to_cart/wibble">, @body=[], @length=0, @etag=nil, @block=nil, @writer=#<Proc:0x00007f41861f8fa0@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @blank=false, @sending_file=false, @cache_control={}>, @_status=200, @_response_body=nil, @_request=#<ActionDispatch::Request:0x7f41847ad7b8 @request_method="GET", @method="GET", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 2, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2012-06-29 19:12:11", updated_at: "2012-06-29 19:12:12">, "rack.session"=>{"cart"=>#<Cart:0x7f4184812d70 @items=[#<CartItem:0x7f4184812ca8 @quantity=2, @product=#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846a4ce0,'0.2995E2',18(18)>>>, #<CartItem:0x7f4184812668 @quantity=1, @product=#<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846a4330,'0.285E2',18(18)>>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f418487c4f0 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/wibble", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :controller=>"store", :id=>"wibble"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/store/add_to_cart/wibble", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<StoreController:0x7f41847ad920 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f418487d440>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @filtered_parameters={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @fullpath="/store/add_to_cart/wibble">, @lookup_context=#<ActionView::LookupContext:0x7f41847acc00 @view_paths=[#<ActionView::FileSystemResolver:0x7f41849fecd8 @caching=false, @cached={}, @path="/home/rubys/git/awdwr/edition3/work-30/depot/app/views">], @details_key=nil, @skip_default_locale=false, @details={:handlers=>[:rxml, :builder, :rjs, :erb, :rhtml], :formats=>[:html], :locale=>[:en, :en]}, @frozen_formats=false>, @_headers={"Content-Type"=>"text/html"}> action_dispatch.parameter_filter: [:password] action_dispatch.remote_ip: #<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f418487c4f0 @check_ip_spoofing=true, @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 2, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2012-06-29 19:12:11", updated_at: "2012-06-29 19:12:12">, "rack.session"=>{"cart"=>#<Cart:0x7f4184812d70 @items=[#<CartItem:0x7f4184812ca8 @quantity=2, @product=#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846a15e0,'0.2995E2',18(18)>>>, #<CartItem:0x7f4184812668 @quantity=1, @product=#<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f41846a0460,'0.285E2',18(18)>>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f418487c4f0 ...>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/wibble", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :controller=>"store", :id=>"wibble"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/store/add_to_cart/wibble", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<StoreController:0x7f41847ad920 @view_context_class=nil, @action_has_layout=true, @_action_name="add_to_cart", @_env={...}, @_params={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @_config=#<OrderedHash {}>, @_response=#<ActionDispatch::Response:0x7f41847ad510 @cookie=[], @header={}, @status=200, @request=#<ActionDispatch::Request:0x7f41847ad7b8 @request_method="GET", @method="GET", @env={...}, @filtered_parameters={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @fullpath="/store/add_to_cart/wibble">, @body=[], @length=0, @etag=nil, @block=nil, @writer=#<Proc:0x00007f41861f8fa0@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @blank=false, @sending_file=false, @cache_control={}>, @_status=200, @_response_body=nil, @_request=#<ActionDispatch::Request:0x7f41847ad7b8 @request_method="GET", @method="GET", @env={...}, @filtered_parameters={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @fullpath="/store/add_to_cart/wibble">, @lookup_context=#<ActionView::LookupContext:0x7f41847acc00 @view_paths=[#<ActionView::FileSystemResolver:0x7f41849fecd8 @caching=false, @cached={}, @path="/home/rubys/git/awdwr/edition3/work-30/depot/app/views">], @details_key=nil, @skip_default_locale=false, @details={:handlers=>[:rxml, :builder, :rjs, :erb, :rhtml], :formats=>[:html], :locale=>[:en, :en]}, @frozen_formats=false>, @_headers={"Content-Type"=>"text/html"}>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f418487d440>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i> action_dispatch.request.accepts: [#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">] action_dispatch.request.content_type: nil action_dispatch.request.formats: [#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">] action_dispatch.request.parameters: {"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"} action_dispatch.request.path_parameters: {:action=>"add_to_cart", :controller=>"store", :id=>"wibble"} action_dispatch.request.query_parameters: {} action_dispatch.request.request_parameters: {} action_dispatch.secret_token: "7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc" action_dispatch.show_exceptions: true rack.errors: #<IO:0x7f418a4a5ab0> rack.input: #<StringIO:0x7f418487d440> rack.multiprocess: false rack.multithread: false rack.request.cookie_hash: {"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"} rack.request.cookie_string: "_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly" rack.request.query_hash: {} rack.request.query_string: "" rack.run_once: false rack.session: {"cart"=>#<Cart:0x7f4184812d70 @items=[#<CartItem:0x7f4184812ca8 @quantity=2, @product=#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f418469d238,'0.2995E2',18(18)>>>, #<CartItem:0x7f4184812668 @quantity=1, @product=#<Product id: 3, title: "Pragmatic Version Control", description: "<p>\n This book is a recipe-based approach t...", image_url: "/images/svn.jpg", created_at: "2012-06-29 19:11:41", updated_at: "2012-06-29 19:11:41", price: #<BigDecimal:7f418469c8b0,'0.285E2',18(18)>>>]>} rack.session.options: {:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil} rack.session.record: #<ActiveRecord::SessionStore::Session id: 2, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2012-06-29 19:12:11", updated_at: "2012-06-29 19:12:12"> rack.url_scheme: "http" rack.version: [1, 1]
Headers:
None
8.4 Iteration C3: Handling Errors 8.2 Iteration C1: Creating a Cart