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:0xb6898e68>
Rails.root: /home/rubys/git/awdwr/work-188/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:364: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:106: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:148: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:430:in `_run__849683412__process_action__746879535__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:404:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:404:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:93:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:93: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/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/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:117:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:40:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:133: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:173:in `action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:89:in `recognize'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:66:in `optimized_each'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:88:in `recognize'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:492:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:8:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.1) 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:177: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:268: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/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107: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:48:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) 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.1) lib/rack/lock.rb:11:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11: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.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/server.rb:162
/home/rubys/git/rails/activemodel/lib/active_model/attribute_methods.rb:364: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:106: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:148: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:430:in `_run__849683412__process_action__746879535__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:404:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:404:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:93:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:93: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/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/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:117:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:40:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:133: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:173:in `action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:89:in `recognize'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:66:in `optimized_each'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:88:in `recognize'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:492:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:8:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.1) 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:177: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:268: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/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107: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:48:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) 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.1) lib/rack/lock.rb:11:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11: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.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/server.rb:162
Parameters:
{"id"=>"2"}
cart: #<Cart:0xb6898ecc @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6aa7178,'0.2995E2',8(8)>>, #<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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6aa6cdc,'0.285E2',8(8)>>]>
GATEWAY_INTERFACE: "CGI/1.1" HTTP_ACCEPT: "text/html" HTTP_COOKIE: "_session_id=cb6d80eb2a253ac2ddf32d1624564db9; 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.8/2010-08-05)" action_controller.instance: #<StoreController:0xb6885c50 @_request=#<ActionDispatch::Request:0xb6885bec @env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 1, session_id: "cb6d80eb2a253ac2ddf32d1624564db9", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2010-08-07 13:14:40", updated_at: "2010-08-07 13:14:40">, "rack.session"=>{"cart"=>#<Cart:0xb6898ecc @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6aa5274,'0.2995E2',8(8)>>, #<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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6aa4e00,'0.285E2',8(8)>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"cb6d80eb2a253ac2ddf32d1624564db9", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb68b6ecc @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @env={...}, @check_ip_spoofing=true>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb75e1174>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.secret_token"=>"992076a47e999acfc3e674f68281bf12c154e138e9d3cfb51a9a65fe28bbf26ed6cebf88e43c6d5e17f6bc46a85c71a47253061cc9c788d0cc10c2825320e670", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.8/2010-08-05)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/2", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :id=>"2", :controller=>"store"}, "rack.request.cookie_string"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; 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:0xb6885c50 ...>, "rack.session.options"=>{:id=>"cb6d80eb2a253ac2ddf32d1624564db9", :path=>"/", :expire_after=>nil, :domain=>nil, :secure=>false, :httponly=>true}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb68b7570>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @request_method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @fullpath="/store/add_to_cart/2", @method="GET">, @_headers={"Content-Type"=>"text/html"}, @view_context_class=nil, @cart=#<Cart:0xb6898ecc @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6aa3f78,'0.2995E2',8(8)>>, #<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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6aa3b04,'0.285E2',8(8)>>]>, @_response=#<ActionDispatch::Response:0xb6885b88 @sending_file=false, @body=[], @status=200, @header={}, @etag=nil, @cookie=[], @blank=false, @request=#<ActionDispatch::Request:0xb6885bec @env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 1, session_id: "cb6d80eb2a253ac2ddf32d1624564db9", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2010-08-07 13:14:40", updated_at: "2010-08-07 13:14:40">, "rack.session"=>{"cart"=>#<Cart:0xb6898ecc @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6aa3028,'0.2995E2',8(8)>>, #<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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6aa2ba0,'0.285E2',8(8)>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"cb6d80eb2a253ac2ddf32d1624564db9", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb68b6ecc @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @env={...}, @check_ip_spoofing=true>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb75e1174>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.secret_token"=>"992076a47e999acfc3e674f68281bf12c154e138e9d3cfb51a9a65fe28bbf26ed6cebf88e43c6d5e17f6bc46a85c71a47253061cc9c788d0cc10c2825320e670", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.8/2010-08-05)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/2", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :id=>"2", :controller=>"store"}, "rack.request.cookie_string"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; 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:0xb6885c50 ...>, "rack.session.options"=>{:id=>"cb6d80eb2a253ac2ddf32d1624564db9", :path=>"/", :expire_after=>nil, :domain=>nil, :secure=>false, :httponly=>true}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb68b7570>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @request_method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @fullpath="/store/add_to_cart/2", @method="GET">, @cache_control={}, @length=0, @block=nil, @writer=#<Proc:0xb6c24d0c@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:44>>, @_action_name="add_to_cart", @_params={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @config=#<OrderedHash {}>, @_env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 1, session_id: "cb6d80eb2a253ac2ddf32d1624564db9", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2010-08-07 13:14:40", updated_at: "2010-08-07 13:14:40">, "rack.session"=>{"cart"=>#<Cart:0xb6898ecc @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6aa1700,'0.2995E2',8(8)>>, #<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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6aa128c,'0.285E2',8(8)>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"cb6d80eb2a253ac2ddf32d1624564db9", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb68b6ecc @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @env={...}, @check_ip_spoofing=true>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb75e1174>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.secret_token"=>"992076a47e999acfc3e674f68281bf12c154e138e9d3cfb51a9a65fe28bbf26ed6cebf88e43c6d5e17f6bc46a85c71a47253061cc9c788d0cc10c2825320e670", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.8/2010-08-05)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/2", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :id=>"2", :controller=>"store"}, "rack.request.cookie_string"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; 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:0xb6885c50 ...>, "rack.session.options"=>{:id=>"cb6d80eb2a253ac2ddf32d1624564db9", :path=>"/", :expire_after=>nil, :domain=>nil, :secure=>false, :httponly=>true}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb68b7570>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @_status=200, @_response_body=nil, @lookup_context=#<ActionView::LookupContext:0xb68859d0 @view_paths=[#<ActionView::FileSystemResolver:0xb754b674 @caching=false, @cached={}, @path="/home/rubys/git/awdwr/work-188/depot/app/views">], @details_key=nil, @skip_default_locale=false, @details={:formats=>[:html], :handlers=>[:builder, :rjs, :rhtml, :erb, :rxml], :locale=>[:en, :en]}, @frozen_formats=false>, @action_has_layout=true> action_dispatch.parameter_filter: [:password] action_dispatch.remote_ip: #<ActionDispatch::RemoteIp::RemoteIpGetter:0xb68b6ecc @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 1, session_id: "cb6d80eb2a253ac2ddf32d1624564db9", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2010-08-07 13:14:40", updated_at: "2010-08-07 13:14:40">, "rack.session"=>{"cart"=>#<Cart:0xb6898ecc @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6a9fd60,'0.2995E2',8(8)>>, #<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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6a9f8ec,'0.285E2',8(8)>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"cb6d80eb2a253ac2ddf32d1624564db9", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb68b6ecc ...>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb75e1174>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.secret_token"=>"992076a47e999acfc3e674f68281bf12c154e138e9d3cfb51a9a65fe28bbf26ed6cebf88e43c6d5e17f6bc46a85c71a47253061cc9c788d0cc10c2825320e670", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.8/2010-08-05)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/2", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :id=>"2", :controller=>"store"}, "rack.request.cookie_string"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; 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:0xb6885c50 @_request=#<ActionDispatch::Request:0xb6885bec @env={...}, @request_method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @fullpath="/store/add_to_cart/2", @method="GET">, @_headers={"Content-Type"=>"text/html"}, @view_context_class=nil, @cart=#<Cart:0xb6898ecc @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6a9ec6c,'0.2995E2',8(8)>>, #<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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6a9dec0,'0.285E2',8(8)>>]>, @_response=#<ActionDispatch::Response:0xb6885b88 @sending_file=false, @body=[], @status=200, @header={}, @etag=nil, @cookie=[], @blank=false, @request=#<ActionDispatch::Request:0xb6885bec @env={...}, @request_method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @fullpath="/store/add_to_cart/2", @method="GET">, @cache_control={}, @length=0, @block=nil, @writer=#<Proc:0xb6c24d0c@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:44>>, @_action_name="add_to_cart", @_params={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @config=#<OrderedHash {}>, @_env={...}, @_status=200, @_response_body=nil, @lookup_context=#<ActionView::LookupContext:0xb68859d0 @view_paths=[#<ActionView::FileSystemResolver:0xb754b674 @caching=false, @cached={}, @path="/home/rubys/git/awdwr/work-188/depot/app/views">], @details_key=nil, @skip_default_locale=false, @details={:formats=>[:html], :handlers=>[:builder, :rjs, :rhtml, :erb, :rxml], :locale=>[:en, :en]}, @frozen_formats=false>, @action_has_layout=true>, "rack.session.options"=>{:id=>"cb6d80eb2a253ac2ddf32d1624564db9", :path=>"/", :expire_after=>nil, :domain=>nil, :secure=>false, :httponly=>true}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb68b7570>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @check_ip_spoofing=true> action_dispatch.request.accepts: [#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>] action_dispatch.request.content_type: nil action_dispatch.request.formats: [#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>] action_dispatch.request.parameters: {"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"} action_dispatch.request.path_parameters: {:action=>"add_to_cart", :id=>"2", :controller=>"store"} action_dispatch.request.query_parameters: {} action_dispatch.request.request_parameters: {} action_dispatch.secret_token: "992076a47e999acfc3e674f68281bf12c154e138e9d3cfb51a9a65fe28bbf26ed6cebf88e43c6d5e17f6bc46a85c71a47253061cc9c788d0cc10c2825320e670" rack.errors: #<IO:0xb75e1174> rack.input: #<StringIO:0xb68b7570> rack.multiprocess: false rack.multithread: false rack.request.cookie_hash: {"HttpOnly"=>nil, "_session_id"=>"cb6d80eb2a253ac2ddf32d1624564db9", "path"=>"/"} rack.request.cookie_string: "_session_id=cb6d80eb2a253ac2ddf32d1624564db9; path=/; HttpOnly" rack.request.query_hash: {} rack.request.query_string: "" rack.run_once: false rack.session: {"cart"=>#<Cart:0xb6898ecc @items=[#<Product id: 2, title: "Pragmatic Project Automation", description: "<p>\n <em>Pragmatic Project Automation</em> sh...", image_url: "/images/auto.jpg", created_at: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6a9b544,'0.2995E2',8(8)>>, #<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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6a9a93c,'0.285E2',8(8)>>]>} rack.session.options: {:id=>"cb6d80eb2a253ac2ddf32d1624564db9", :path=>"/", :expire_after=>nil, :domain=>nil, :secure=>false, :httponly=>true} rack.session.record: #<ActiveRecord::SessionStore::Session id: 1, session_id: "cb6d80eb2a253ac2ddf32d1624564db9", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2010-08-07 13:14:40", updated_at: "2010-08-07 13:14:40"> rack.url_scheme: "http" rack.version: [1, 1]
Headers:
None
rake db:sessions:clear
(in /home/rubys/git/awdwr/work-188/depot)
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/work-188/depot
app/controllers/store_controller.rb:9:in `add_to_cart'
/home/rubys/git/rails/activerecord/lib/active_record/relation/finder_methods.rb:296:in `find_one'
/home/rubys/git/rails/activerecord/lib/active_record/relation/finder_methods.rb:281: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:439:in `__send__'
/home/rubys/git/rails/activerecord/lib/active_record/base.rb:439: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:148: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:430:in `_run__849683412__process_action__746879535__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:404:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:404:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:93:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:93: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/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/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:117:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:40:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:133: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:173:in `action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:89:in `recognize'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:66:in `optimized_each'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:88:in `recognize'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:492:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:8:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.1) 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:177: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:268: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/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107: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:48:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) 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.1) lib/rack/lock.rb:11:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11: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.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/server.rb:162
/home/rubys/git/rails/activerecord/lib/active_record/relation/finder_methods.rb:296:in `find_one'
/home/rubys/git/rails/activerecord/lib/active_record/relation/finder_methods.rb:281: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:439:in `__send__'
/home/rubys/git/rails/activerecord/lib/active_record/base.rb:439: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:148: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:430:in `_run__849683412__process_action__746879535__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:404:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:404:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:93:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:93: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/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/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:117:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:40:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:133: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:173:in `action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:89:in `recognize'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:66:in `optimized_each'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:88:in `recognize'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:492:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:8:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.1) 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:177: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:268: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/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107: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:48:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) 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.1) lib/rack/lock.rb:11:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11: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.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.8-r28862/lib/ruby/1.8/webrick/server.rb:162
Parameters:
{"id"=>"wibble"}
cart: #<Cart:0xb68d3194 @items=[#<CartItem:0xb68d3054 @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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6864064,'0.2995E2',8(8)>>>, #<CartItem:0xb68d2bb8 @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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6863b8c,'0.285E2',8(8)>>>]>
GATEWAY_INTERFACE: "CGI/1.1" HTTP_ACCEPT: "text/html" HTTP_COOKIE: "_session_id=cb6d80eb2a253ac2ddf32d1624564db9; 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.8/2010-08-05)" action_controller.instance: #<StoreController:0xb68b985c @_request=#<ActionDispatch::Request:0xb68b97f8 @env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 2, session_id: "cb6d80eb2a253ac2ddf32d1624564db9", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2010-08-07 13:14:44", updated_at: "2010-08-07 13:14:44">, "rack.session"=>{"cart"=>#<Cart:0xb68d3194 @items=[#<CartItem:0xb68d3054 @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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6862034,'0.2995E2',8(8)>>>, #<CartItem:0xb68d2bb8 @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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6861b98,'0.285E2',8(8)>>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"cb6d80eb2a253ac2ddf32d1624564db9", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb68fcf08 @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @env={...}, @check_ip_spoofing=true>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb75e1174>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.secret_token"=>"992076a47e999acfc3e674f68281bf12c154e138e9d3cfb51a9a65fe28bbf26ed6cebf88e43c6d5e17f6bc46a85c71a47253061cc9c788d0cc10c2825320e670", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.8/2010-08-05)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/wibble", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :id=>"wibble", :controller=>"store"}, "rack.request.cookie_string"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; 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:0xb68b985c ...>, "rack.session.options"=>{:id=>"cb6d80eb2a253ac2ddf32d1624564db9", :path=>"/", :expire_after=>nil, :domain=>nil, :secure=>false, :httponly=>true}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb68fd5fc>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @request_method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @fullpath="/store/add_to_cart/wibble", @method="GET">, @_headers={"Content-Type"=>"text/html"}, @view_context_class=nil, @_response=#<ActionDispatch::Response:0xb68b9758 @sending_file=false, @body=[], @status=200, @header={}, @etag=nil, @cookie=[], @blank=false, @request=#<ActionDispatch::Request:0xb68b97f8 @env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 2, session_id: "cb6d80eb2a253ac2ddf32d1624564db9", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2010-08-07 13:14:44", updated_at: "2010-08-07 13:14:44">, "rack.session"=>{"cart"=>#<Cart:0xb68d3194 @items=[#<CartItem:0xb68d3054 @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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b686070c,'0.2995E2',8(8)>>>, #<CartItem:0xb68d2bb8 @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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b6860270,'0.285E2',8(8)>>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"cb6d80eb2a253ac2ddf32d1624564db9", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb68fcf08 @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @env={...}, @check_ip_spoofing=true>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb75e1174>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.secret_token"=>"992076a47e999acfc3e674f68281bf12c154e138e9d3cfb51a9a65fe28bbf26ed6cebf88e43c6d5e17f6bc46a85c71a47253061cc9c788d0cc10c2825320e670", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.8/2010-08-05)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/wibble", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :id=>"wibble", :controller=>"store"}, "rack.request.cookie_string"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; 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:0xb68b985c ...>, "rack.session.options"=>{:id=>"cb6d80eb2a253ac2ddf32d1624564db9", :path=>"/", :expire_after=>nil, :domain=>nil, :secure=>false, :httponly=>true}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb68fd5fc>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @request_method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @fullpath="/store/add_to_cart/wibble", @method="GET">, @cache_control={}, @length=0, @block=nil, @writer=#<Proc:0xb6c24d0c@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:44>>, @_action_name="add_to_cart", @_params={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @config=#<OrderedHash {}>, @_env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 2, session_id: "cb6d80eb2a253ac2ddf32d1624564db9", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2010-08-07 13:14:44", updated_at: "2010-08-07 13:14:44">, "rack.session"=>{"cart"=>#<Cart:0xb68d3194 @items=[#<CartItem:0xb68d3054 @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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b685edd0,'0.2995E2',8(8)>>>, #<CartItem:0xb68d2bb8 @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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b685e934,'0.285E2',8(8)>>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"cb6d80eb2a253ac2ddf32d1624564db9", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb68fcf08 @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @env={...}, @check_ip_spoofing=true>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb75e1174>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.secret_token"=>"992076a47e999acfc3e674f68281bf12c154e138e9d3cfb51a9a65fe28bbf26ed6cebf88e43c6d5e17f6bc46a85c71a47253061cc9c788d0cc10c2825320e670", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.8/2010-08-05)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/wibble", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :id=>"wibble", :controller=>"store"}, "rack.request.cookie_string"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; 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:0xb68b985c ...>, "rack.session.options"=>{:id=>"cb6d80eb2a253ac2ddf32d1624564db9", :path=>"/", :expire_after=>nil, :domain=>nil, :secure=>false, :httponly=>true}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb68fd5fc>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @_status=200, @_response_body=nil, @lookup_context=#<ActionView::LookupContext:0xb68b9230 @view_paths=[#<ActionView::FileSystemResolver:0xb754b674 @caching=false, @cached={}, @path="/home/rubys/git/awdwr/work-188/depot/app/views">], @details_key=nil, @skip_default_locale=false, @details={:formats=>[:html], :handlers=>[:builder, :rjs, :rhtml, :erb, :rxml], :locale=>[:en, :en]}, @frozen_formats=false>, @action_has_layout=true> action_dispatch.parameter_filter: [:password] action_dispatch.remote_ip: #<ActionDispatch::RemoteIp::RemoteIpGetter:0xb68fcf08 @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.request.parameters"=>{"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 2, session_id: "cb6d80eb2a253ac2ddf32d1624564db9", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2010-08-07 13:14:44", updated_at: "2010-08-07 13:14:44">, "rack.session"=>{"cart"=>#<Cart:0xb68d3194 @items=[#<CartItem:0xb68d3054 @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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b685d3e0,'0.2995E2',8(8)>>>, #<CartItem:0xb68d2bb8 @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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b685cf44,'0.285E2',8(8)>>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"cb6d80eb2a253ac2ddf32d1624564db9", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb68fcf08 ...>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb75e1174>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>], "action_dispatch.secret_token"=>"992076a47e999acfc3e674f68281bf12c154e138e9d3cfb51a9a65fe28bbf26ed6cebf88e43c6d5e17f6bc46a85c71a47253061cc9c788d0cc10c2825320e670", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.8/2010-08-05)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/wibble", "action_dispatch.request.path_parameters"=>{:action=>"add_to_cart", :id=>"wibble", :controller=>"store"}, "rack.request.cookie_string"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=cb6d80eb2a253ac2ddf32d1624564db9; 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:0xb68b985c @_request=#<ActionDispatch::Request:0xb68b97f8 @env={...}, @request_method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @fullpath="/store/add_to_cart/wibble", @method="GET">, @_headers={"Content-Type"=>"text/html"}, @view_context_class=nil, @_response=#<ActionDispatch::Response:0xb68b9758 @sending_file=false, @body=[], @status=200, @header={}, @etag=nil, @cookie=[], @blank=false, @request=#<ActionDispatch::Request:0xb68b97f8 @env={...}, @request_method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @fullpath="/store/add_to_cart/wibble", @method="GET">, @cache_control={}, @length=0, @block=nil, @writer=#<Proc:0xb6c24d0c@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:44>>, @_action_name="add_to_cart", @_params={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @config=#<OrderedHash {}>, @_env={...}, @_status=200, @_response_body=nil, @lookup_context=#<ActionView::LookupContext:0xb68b9230 @view_paths=[#<ActionView::FileSystemResolver:0xb754b674 @caching=false, @cached={}, @path="/home/rubys/git/awdwr/work-188/depot/app/views">], @details_key=nil, @skip_default_locale=false, @details={:formats=>[:html], :handlers=>[:builder, :rjs, :rhtml, :erb, :rxml], :locale=>[:en, :en]}, @frozen_formats=false>, @action_has_layout=true>, "rack.session.options"=>{:id=>"cb6d80eb2a253ac2ddf32d1624564db9", :path=>"/", :expire_after=>nil, :domain=>nil, :secure=>false, :httponly=>true}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb68fd5fc>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @check_ip_spoofing=true> action_dispatch.request.accepts: [#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>] action_dispatch.request.content_type: nil action_dispatch.request.formats: [#<Mime::Type:0xb6fa6ffc @string="text/html", @synonyms=["application/xhtml+xml"], @symbol=:html>] action_dispatch.request.parameters: {"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"} action_dispatch.request.path_parameters: {:action=>"add_to_cart", :id=>"wibble", :controller=>"store"} action_dispatch.request.query_parameters: {} action_dispatch.request.request_parameters: {} action_dispatch.secret_token: "992076a47e999acfc3e674f68281bf12c154e138e9d3cfb51a9a65fe28bbf26ed6cebf88e43c6d5e17f6bc46a85c71a47253061cc9c788d0cc10c2825320e670" rack.errors: #<IO:0xb75e1174> rack.input: #<StringIO:0xb68fd5fc> rack.multiprocess: false rack.multithread: false rack.request.cookie_hash: {"HttpOnly"=>nil, "_session_id"=>"cb6d80eb2a253ac2ddf32d1624564db9", "path"=>"/"} rack.request.cookie_string: "_session_id=cb6d80eb2a253ac2ddf32d1624564db9; path=/; HttpOnly" rack.request.query_hash: {} rack.request.query_string: "" rack.run_once: false rack.session: {"cart"=>#<Cart:0xb68d3194 @items=[#<CartItem:0xb68d3054 @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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b68b98c0,'0.2995E2',8(8)>>>, #<CartItem:0xb68d2bb8 @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: "2010-08-07 13:14:15", updated_at: "2010-08-07 13:14:15", price: #<BigDecimal:b68eebec,'0.285E2',8(8)>>>]>} rack.session.options: {:id=>"cb6d80eb2a253ac2ddf32d1624564db9", :path=>"/", :expire_after=>nil, :domain=>nil, :secure=>false, :httponly=>true} rack.session.record: #<ActiveRecord::SessionStore::Session id: 2, session_id: "cb6d80eb2a253ac2ddf32d1624564db9", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2010-08-07 13:14:44", updated_at: "2010-08-07 13:14:44"> rack.url_scheme: "http" rack.version: [1, 1]
Headers:
None
8.4 Iteration C3: Handling Errors 8.2 Iteration C1: Creating a Cart