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:0xb6775054>
Rails.root: /home/rubys/git/awdwr/work/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: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:435:in `_run__849683412__process_action__746879535__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:409:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:409: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:119: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.13) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.13) 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:17: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: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:287: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:355: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:415: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:46: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.7-p302/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.1) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.1) lib/rack/server.rb:213: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: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: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:435:in `_run__849683412__process_action__746879535__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:409:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:409: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:119: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.13) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.13) 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:17: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: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:287: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:355: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:415: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:46: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.7-p302/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.1) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.1) lib/rack/server.rb:213: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:0xb67750b8 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69b3cf8,'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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69b385c,'0.285E2',8(8)>>]>
GATEWAY_INTERFACE: "CGI/1.1" HTTP_ACCEPT: "text/html" HTTP_COOKIE: "_session_id=68d0f04a5dd90181874c92dec3a78573; 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/2010-08-16)" action_controller.instance: #<StoreController:0xb67574a0 @lookup_context=#<ActionView::LookupContext:0xb6757220 @skip_default_locale=false, @details={:locale=>[:en, :en], :formats=>[:html], :handlers=>[:rhtml, :rxml, :erb, :rjs, :builder]}, @frozen_formats=false, @view_paths=[#<ActionView::FileSystemResolver:0xb6b4637c @path="/home/rubys/git/awdwr/work/depot/app/views", @caching=false, @cached={}>], @details_key=nil>, @action_has_layout=true, @_status=200, @view_context_class=nil, @_response_body=nil, @_request=#<ActionDispatch::Request:0xb675743c @request_method="GET", @fullpath="/store/add_to_cart/2", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb706db34 @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: "68d0f04a5dd90181874c92dec3a78573", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2010-09-06 01:11:54", updated_at: "2010-09-06 01:11:54">, "rack.session"=>{"cart"=>#<Cart:0xb67750b8 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69b1b9c,'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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69b16ec,'0.285E2',8(8)>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"68d0f04a5dd90181874c92dec3a78573", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb6791c40 @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @check_ip_spoofing=true>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb74e4550>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb706db34 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"d9df5425e72949c1b5443e0cc625dd7bb6c0b6f8e50717c99ad53d4c8b206f7f3644d8eba6a556c7c59382e885a47c2ad3cf23931c346407cd7687ed98214f53", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2010-08-16)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/2", "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"add_to_cart", :id=>"2"}, "rack.request.cookie_string"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; 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:0xb67574a0 ...>, "rack.session.options"=>{:domain=>nil, :httponly=>true, :secure=>false, :expire_after=>nil, :id=>"68d0f04a5dd90181874c92dec3a78573", :path=>"/"}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb67922e4>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}>, @_response=#<ActionDispatch::Response:0xb67573d8 @header={}, @etag=nil, @blank=false, @writer=#<Proc:0xb6bc954c@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @block=nil, @cache_control={}, @sending_file=false, @cookie=[], @request=#<ActionDispatch::Request:0xb675743c @request_method="GET", @fullpath="/store/add_to_cart/2", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb706db34 @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: "68d0f04a5dd90181874c92dec3a78573", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2010-09-06 01:11:54", updated_at: "2010-09-06 01:11:54">, "rack.session"=>{"cart"=>#<Cart:0xb67750b8 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69b0260,'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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69afdd8,'0.285E2',8(8)>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"68d0f04a5dd90181874c92dec3a78573", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb6791c40 @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @check_ip_spoofing=true>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb74e4550>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb706db34 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"d9df5425e72949c1b5443e0cc625dd7bb6c0b6f8e50717c99ad53d4c8b206f7f3644d8eba6a556c7c59382e885a47c2ad3cf23931c346407cd7687ed98214f53", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2010-08-16)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/2", "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"add_to_cart", :id=>"2"}, "rack.request.cookie_string"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; 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:0xb67574a0 ...>, "rack.session.options"=>{:domain=>nil, :httponly=>true, :secure=>false, :expire_after=>nil, :id=>"68d0f04a5dd90181874c92dec3a78573", :path=>"/"}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb67922e4>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}>, @status=200, @body=[], @length=0>, @_headers={"Content-Type"=>"text/html"}, @cart=#<Cart:0xb67750b8 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69aef64,'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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69aeaf0,'0.285E2',8(8)>>]>, @_action_name="add_to_cart", @_params={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @_config=#<OrderedHash {}>, @_env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb706db34 @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: "68d0f04a5dd90181874c92dec3a78573", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2010-09-06 01:11:54", updated_at: "2010-09-06 01:11:54">, "rack.session"=>{"cart"=>#<Cart:0xb67750b8 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69ae028,'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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69adbb4,'0.285E2',8(8)>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"68d0f04a5dd90181874c92dec3a78573", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb6791c40 @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @check_ip_spoofing=true>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb74e4550>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb706db34 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"d9df5425e72949c1b5443e0cc625dd7bb6c0b6f8e50717c99ad53d4c8b206f7f3644d8eba6a556c7c59382e885a47c2ad3cf23931c346407cd7687ed98214f53", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2010-08-16)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/2", "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"add_to_cart", :id=>"2"}, "rack.request.cookie_string"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; 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:0xb67574a0 ...>, "rack.session.options"=>{:domain=>nil, :httponly=>true, :secure=>false, :expire_after=>nil, :id=>"68d0f04a5dd90181874c92dec3a78573", :path=>"/"}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb67922e4>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}> action_dispatch.parameter_filter: [:password] action_dispatch.remote_ip: #<ActionDispatch::RemoteIp::RemoteIpGetter:0xb6791c40 @env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb706db34 @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: "68d0f04a5dd90181874c92dec3a78573", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2010-09-06 01:11:54", updated_at: "2010-09-06 01:11:54">, "rack.session"=>{"cart"=>#<Cart:0xb67750b8 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69ac8b8,'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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69ac444,'0.285E2',8(8)>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"68d0f04a5dd90181874c92dec3a78573", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb6791c40 ...>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb74e4550>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb706db34 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"d9df5425e72949c1b5443e0cc625dd7bb6c0b6f8e50717c99ad53d4c8b206f7f3644d8eba6a556c7c59382e885a47c2ad3cf23931c346407cd7687ed98214f53", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2010-08-16)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/2", "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"add_to_cart", :id=>"2"}, "rack.request.cookie_string"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; 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:0xb67574a0 @lookup_context=#<ActionView::LookupContext:0xb6757220 @skip_default_locale=false, @details={:locale=>[:en, :en], :formats=>[:html], :handlers=>[:rhtml, :rxml, :erb, :rjs, :builder]}, @frozen_formats=false, @view_paths=[#<ActionView::FileSystemResolver:0xb6b4637c @path="/home/rubys/git/awdwr/work/depot/app/views", @caching=false, @cached={}>], @details_key=nil>, @action_has_layout=true, @_status=200, @view_context_class=nil, @_response_body=nil, @_request=#<ActionDispatch::Request:0xb675743c @request_method="GET", @fullpath="/store/add_to_cart/2", @env={...}, @method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}>, @_response=#<ActionDispatch::Response:0xb67573d8 @header={}, @etag=nil, @blank=false, @writer=#<Proc:0xb6bc954c@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @block=nil, @cache_control={}, @sending_file=false, @cookie=[], @request=#<ActionDispatch::Request:0xb675743c @request_method="GET", @fullpath="/store/add_to_cart/2", @env={...}, @method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}>, @status=200, @body=[], @length=0>, @_headers={"Content-Type"=>"text/html"}, @cart=#<Cart:0xb67750b8 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69ab3c8,'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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69aaf54,'0.285E2',8(8)>>]>, @_action_name="add_to_cart", @_params={"action"=>"add_to_cart", "id"=>"2", "controller"=>"store"}, @_config=#<OrderedHash {}>, @_env={...}>, "rack.session.options"=>{:domain=>nil, :httponly=>true, :secure=>false, :expire_after=>nil, :id=>"68d0f04a5dd90181874c92dec3a78573", :path=>"/"}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb67922e4>, "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, @check_ip_spoofing=true> action_dispatch.request.accepts: [#<Mime::Type:0xb706db34 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">] action_dispatch.request.content_type: nil action_dispatch.request.formats: [#<Mime::Type:0xb706db34 @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: {:controller=>"store", :action=>"add_to_cart", :id=>"2"} action_dispatch.request.query_parameters: {} action_dispatch.request.request_parameters: {} action_dispatch.secret_token: "d9df5425e72949c1b5443e0cc625dd7bb6c0b6f8e50717c99ad53d4c8b206f7f3644d8eba6a556c7c59382e885a47c2ad3cf23931c346407cd7687ed98214f53" rack.errors: #<IO:0xb74e4550> rack.input: #<StringIO:0xb67922e4> rack.multiprocess: false rack.multithread: false rack.request.cookie_hash: {"HttpOnly"=>nil, "_session_id"=>"68d0f04a5dd90181874c92dec3a78573", "path"=>"/"} rack.request.cookie_string: "_session_id=68d0f04a5dd90181874c92dec3a78573; path=/; HttpOnly" rack.request.query_hash: {} rack.request.query_string: "" rack.run_once: false rack.session: {"cart"=>#<Cart:0xb67750b8 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69aa284,'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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b69a9e10,'0.285E2',8(8)>>]>} rack.session.options: {:domain=>nil, :httponly=>true, :secure=>false, :expire_after=>nil, :id=>"68d0f04a5dd90181874c92dec3a78573", :path=>"/"} rack.session.record: #<ActiveRecord::SessionStore::Session id: 1, session_id: "68d0f04a5dd90181874c92dec3a78573", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DFByb2R1Y3Q...", created_at: "2010-09-06 01:11:54", updated_at: "2010-09-06 01:11:54"> rack.url_scheme: "http" rack.version: [1, 1]
Headers:
None
rake db:sessions:clear
(in /home/rubys/git/awdwr/work/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/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: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:435:in `_run__849683412__process_action__746879535__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:409:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:409: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:119: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.13) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.13) 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:17: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: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:287: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:355: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:415: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:46: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.7-p302/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.1) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.1) lib/rack/server.rb:213: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: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: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:435:in `_run__849683412__process_action__746879535__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:409:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:409: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:119: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.13) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.13) 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:17: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: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:287: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:355: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:415: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:46: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.7-p302/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.1) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.1) lib/rack/server.rb:213: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:0xb67c7fac @items=[#<CartItem:0xb67c7f48 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b6748bbc,'0.2995E2',8(8)>>>, #<CartItem:0xb67c7c28 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b674861c,'0.285E2',8(8)>>>]>
GATEWAY_INTERFACE: "CGI/1.1" HTTP_ACCEPT: "text/html" HTTP_COOKIE: "_session_id=68d0f04a5dd90181874c92dec3a78573; 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/2010-08-16)" action_controller.instance: #<StoreController:0xb67a2e3c @lookup_context=#<ActionView::LookupContext:0xb67a2a7c @skip_default_locale=false, @details={:locale=>[:en, :en], :formats=>[:html], :handlers=>[:rhtml, :rxml, :erb, :rjs, :builder]}, @frozen_formats=false, @view_paths=[#<ActionView::FileSystemResolver:0xb6b4637c @path="/home/rubys/git/awdwr/work/depot/app/views", @caching=false, @cached={}>], @details_key=nil>, @action_has_layout=true, @_status=200, @view_context_class=nil, @_response_body=nil, @_request=#<ActionDispatch::Request:0xb67a2cfc @request_method="GET", @fullpath="/store/add_to_cart/wibble", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb706db34 @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: "68d0f04a5dd90181874c92dec3a78573", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2010-09-06 01:11:57", updated_at: "2010-09-06 01:11:57">, "rack.session"=>{"cart"=>#<Cart:0xb67c7fac @items=[#<CartItem:0xb67c7f48 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b6745a70,'0.2995E2',8(8)>>>, #<CartItem:0xb67c7c28 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b6745354,'0.285E2',8(8)>>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"68d0f04a5dd90181874c92dec3a78573", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb67ef4d0 @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @check_ip_spoofing=true>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb74e4550>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb706db34 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"d9df5425e72949c1b5443e0cc625dd7bb6c0b6f8e50717c99ad53d4c8b206f7f3644d8eba6a556c7c59382e885a47c2ad3cf23931c346407cd7687ed98214f53", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2010-08-16)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/wibble", "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"add_to_cart", :id=>"wibble"}, "rack.request.cookie_string"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; 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:0xb67a2e3c ...>, "rack.session.options"=>{:domain=>nil, :httponly=>true, :secure=>false, :expire_after=>nil, :id=>"68d0f04a5dd90181874c92dec3a78573", :path=>"/"}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb67efb74>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}>, @_response=#<ActionDispatch::Response:0xb67a2c70 @header={}, @etag=nil, @blank=false, @writer=#<Proc:0xb6bc954c@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @block=nil, @cache_control={}, @sending_file=false, @cookie=[], @request=#<ActionDispatch::Request:0xb67a2cfc @request_method="GET", @fullpath="/store/add_to_cart/wibble", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb706db34 @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: "68d0f04a5dd90181874c92dec3a78573", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2010-09-06 01:11:57", updated_at: "2010-09-06 01:11:57">, "rack.session"=>{"cart"=>#<Cart:0xb67c7fac @items=[#<CartItem:0xb67c7f48 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b6742dc0,'0.2995E2',8(8)>>>, #<CartItem:0xb67c7c28 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b6742500,'0.285E2',8(8)>>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"68d0f04a5dd90181874c92dec3a78573", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb67ef4d0 @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @check_ip_spoofing=true>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb74e4550>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb706db34 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"d9df5425e72949c1b5443e0cc625dd7bb6c0b6f8e50717c99ad53d4c8b206f7f3644d8eba6a556c7c59382e885a47c2ad3cf23931c346407cd7687ed98214f53", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2010-08-16)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/wibble", "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"add_to_cart", :id=>"wibble"}, "rack.request.cookie_string"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; 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:0xb67a2e3c ...>, "rack.session.options"=>{:domain=>nil, :httponly=>true, :secure=>false, :expire_after=>nil, :id=>"68d0f04a5dd90181874c92dec3a78573", :path=>"/"}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb67efb74>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}>, @status=200, @body=[], @length=0>, @_headers={"Content-Type"=>"text/html"}, @_action_name="add_to_cart", @_params={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @_config=#<OrderedHash {}>, @_env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb706db34 @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: "68d0f04a5dd90181874c92dec3a78573", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2010-09-06 01:11:57", updated_at: "2010-09-06 01:11:57">, "rack.session"=>{"cart"=>#<Cart:0xb67c7fac @items=[#<CartItem:0xb67c7f48 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b674032c,'0.2995E2',8(8)>>>, #<CartItem:0xb67c7c28 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b673fc10,'0.285E2',8(8)>>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"68d0f04a5dd90181874c92dec3a78573", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb67ef4d0 @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i, @check_ip_spoofing=true>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb74e4550>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb706db34 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"d9df5425e72949c1b5443e0cc625dd7bb6c0b6f8e50717c99ad53d4c8b206f7f3644d8eba6a556c7c59382e885a47c2ad3cf23931c346407cd7687ed98214f53", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2010-08-16)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/wibble", "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"add_to_cart", :id=>"wibble"}, "rack.request.cookie_string"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; 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:0xb67a2e3c ...>, "rack.session.options"=>{:domain=>nil, :httponly=>true, :secure=>false, :expire_after=>nil, :id=>"68d0f04a5dd90181874c92dec3a78573", :path=>"/"}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb67efb74>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}> action_dispatch.parameter_filter: [:password] action_dispatch.remote_ip: #<ActionDispatch::RemoteIp::RemoteIpGetter:0xb67ef4d0 @env={"action_dispatch.request.formats"=>[#<Mime::Type:0xb706db34 @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: "68d0f04a5dd90181874c92dec3a78573", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2010-09-06 01:11:57", updated_at: "2010-09-06 01:11:57">, "rack.session"=>{"cart"=>#<Cart:0xb67c7fac @items=[#<CartItem:0xb67c7f48 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b673d8d4,'0.2995E2',8(8)>>>, #<CartItem:0xb67c7c28 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b673d1b8,'0.285E2',8(8)>>>]>}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"68d0f04a5dd90181874c92dec3a78573", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0xb67ef4d0 ...>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0xb74e4550>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0xb706db34 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"d9df5425e72949c1b5443e0cc625dd7bb6c0b6f8e50717c99ad53d4c8b206f7f3644d8eba6a556c7c59382e885a47c2ad3cf23931c346407cd7687ed98214f53", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2010-08-16)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/store/add_to_cart/wibble", "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"add_to_cart", :id=>"wibble"}, "rack.request.cookie_string"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=68d0f04a5dd90181874c92dec3a78573; 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:0xb67a2e3c @lookup_context=#<ActionView::LookupContext:0xb67a2a7c @skip_default_locale=false, @details={:locale=>[:en, :en], :formats=>[:html], :handlers=>[:rhtml, :rxml, :erb, :rjs, :builder]}, @frozen_formats=false, @view_paths=[#<ActionView::FileSystemResolver:0xb6b4637c @path="/home/rubys/git/awdwr/work/depot/app/views", @caching=false, @cached={}>], @details_key=nil>, @action_has_layout=true, @_status=200, @view_context_class=nil, @_response_body=nil, @_request=#<ActionDispatch::Request:0xb67a2cfc @request_method="GET", @fullpath="/store/add_to_cart/wibble", @env={...}, @method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}>, @_response=#<ActionDispatch::Response:0xb67a2c70 @header={}, @etag=nil, @blank=false, @writer=#<Proc:0xb6bc954c@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @block=nil, @cache_control={}, @sending_file=false, @cookie=[], @request=#<ActionDispatch::Request:0xb67a2cfc @request_method="GET", @fullpath="/store/add_to_cart/wibble", @env={...}, @method="GET", @filtered_parameters={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}>, @status=200, @body=[], @length=0>, @_headers={"Content-Type"=>"text/html"}, @_action_name="add_to_cart", @_params={"action"=>"add_to_cart", "id"=>"wibble", "controller"=>"store"}, @_config=#<OrderedHash {}>, @_env={...}>, "rack.session.options"=>{:domain=>nil, :httponly=>true, :secure=>false, :expire_after=>nil, :id=>"68d0f04a5dd90181874c92dec3a78573", :path=>"/"}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0xb67efb74>, "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, @check_ip_spoofing=true> action_dispatch.request.accepts: [#<Mime::Type:0xb706db34 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">] action_dispatch.request.content_type: nil action_dispatch.request.formats: [#<Mime::Type:0xb706db34 @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: {:controller=>"store", :action=>"add_to_cart", :id=>"wibble"} action_dispatch.request.query_parameters: {} action_dispatch.request.request_parameters: {} action_dispatch.secret_token: "d9df5425e72949c1b5443e0cc625dd7bb6c0b6f8e50717c99ad53d4c8b206f7f3644d8eba6a556c7c59382e885a47c2ad3cf23931c346407cd7687ed98214f53" rack.errors: #<IO:0xb74e4550> rack.input: #<StringIO:0xb67efb74> rack.multiprocess: false rack.multithread: false rack.request.cookie_hash: {"HttpOnly"=>nil, "_session_id"=>"68d0f04a5dd90181874c92dec3a78573", "path"=>"/"} rack.request.cookie_string: "_session_id=68d0f04a5dd90181874c92dec3a78573; path=/; HttpOnly" rack.request.query_hash: {} rack.request.query_string: "" rack.run_once: false rack.session: {"cart"=>#<Cart:0xb67c7fac @items=[#<CartItem:0xb67c7f48 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b67ddcbc,'0.2995E2',8(8)>>>, #<CartItem:0xb67c7c28 @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-09-06 01:11:35", updated_at: "2010-09-06 01:11:35", price: #<BigDecimal:b67f7360,'0.285E2',8(8)>>>]>} rack.session.options: {:domain=>nil, :httponly=>true, :secure=>false, :expire_after=>nil, :id=>"68d0f04a5dd90181874c92dec3a78573", :path=>"/"} rack.session.record: #<ActiveRecord::SessionStore::Session id: 2, session_id: "68d0f04a5dd90181874c92dec3a78573", data: "BAh7BiIJY2FydG86CUNhcnQGOgtAaXRlbXNbB286DUNhcnRJdGV...", created_at: "2010-09-06 01:11:57", updated_at: "2010-09-06 01:11:57"> rack.url_scheme: "http" rack.version: [1, 1]
Headers:
None
8.4 Iteration C3: Handling Errors 8.2 Iteration C1: Creating a Cart