12.1 Iteration G1: Capturing an Order 11.4 Iteration F4: Hide an Empty Cart
Verify that yes, indeed, the product index is broken.
get /products
Showing /home/rubys/git/awdwr/edition4/work-30/depot/app/views/layouts/application.html.erb where line #20 raised:
undefined method `line_items' for nil:NilClass
Extracted source (around line #20):
17: <div id="side">
18: <!-- START_HIGHLIGHT -->
19: <!-- START:hidden_div -->
20: <%= hidden_div_if(@cart.line_items.empty?, :id => 'cart') do %>
21: <%= render @cart %>
22: <% end %>
23: <!-- END:hidden_div -->
Rails.root: /home/rubys/git/awdwr/edition4/work-30/depot
app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb__935027895_70064183935800_0'
app/controllers/products_controller.rb:7:in `index'
/home/rubys/git/rails/activesupport/lib/active_support/whiny_nil.rb:48:in `method_missing'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:135:in `send'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:135:in `render'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:54:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:127:in `render'
/home/rubys/git/rails/actionpack/lib/action_view/render/layouts.rb:80:in `_render_layout'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:62:in `_render_template'
/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_view/render/rendering.rb:56:in `_render_template'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:26:in `render'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:115:in `_render_template'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:109:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:47:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:102:in `render_to_string'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:93:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:17:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `render'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
/home/rubys/git/rails/activerecord/lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:39:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/mime_responds.rb:261:in `retrieve_response_from_mimes'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/mime_responds.rb:192:in `call'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/mime_responds.rb:192:in `respond_to'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:150:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:436:in `_run__1118320962__process_action__199225275__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:119:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:41:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:138:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:178:in `action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:33:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:499:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.5) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:182:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.5) lib/rack/sendfile.rb:106:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.5) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `synchronize'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `send'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.5) lib/rack/content_length.rb:13:in `call'
rack (1.2.5) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.5) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.5) lib/rack/server.rb:217:in `start'
/home/rubys/git/rails/railties/lib/rails/commands/server.rb:65:in `start'
/home/rubys/git/rails/railties/lib/rails/commands.rb:30
/home/rubys/git/rails/railties/lib/rails/commands.rb:27:in `tap'
/home/rubys/git/rails/railties/lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
/home/rubys/git/rails/activesupport/lib/active_support/whiny_nil.rb:48:in `method_missing'
app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb__935027895_70064183935800_0'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:135:in `send'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:135:in `render'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:54:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:127:in `render'
/home/rubys/git/rails/actionpack/lib/action_view/render/layouts.rb:80:in `_render_layout'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:62:in `_render_template'
/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_view/render/rendering.rb:56:in `_render_template'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:26:in `render'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:115:in `_render_template'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:109:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:47:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:102:in `render_to_string'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:93:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:17:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `render'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
/home/rubys/git/rails/activerecord/lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:39:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/mime_responds.rb:261:in `retrieve_response_from_mimes'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/mime_responds.rb:192:in `call'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/mime_responds.rb:192:in `respond_to'
app/controllers/products_controller.rb:7:in `index'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:150:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:436:in `_run__1118320962__process_action__199225275__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `send'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:119:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:41:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:138:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:178:in `action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:33:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:499:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.5) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:182:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.5) lib/rack/sendfile.rb:106:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.5) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
rack (1.2.5) lib/rack/lock.rb:13:in `synchronize'
rack (1.2.5) lib/rack/lock.rb:13:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `send'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.5) lib/rack/content_length.rb:13:in `call'
rack (1.2.5) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.5) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.5) lib/rack/server.rb:217:in `start'
/home/rubys/git/rails/railties/lib/rails/commands/server.rb:65:in `start'
/home/rubys/git/rails/railties/lib/rails/commands.rb:30
/home/rubys/git/rails/railties/lib/rails/commands.rb:27:in `tap'
/home/rubys/git/rails/railties/lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
Parameters:
None
_csrf_token: "XfBkHT3bi21zPDXz4/aaqukTv2yc783VZwcBDNHbDWE=" cart_id: 3 session_id: "6f8035ed41e1d1979f63f558302a290d"
GATEWAY_INTERFACE: "CGI/1.1" HTTP_ACCEPT: "text/html" HTTP_COOKIE: "_depot_session=BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76; path=/; HttpOnly" HTTP_HOST: "localhost:3000" HTTP_VERSION: "HTTP/1.1" PATH_INFO: "/products" QUERY_STRING: "" REMOTE_ADDR: "127.0.0.1" REMOTE_HOST: "localhost" REQUEST_METHOD: "GET" REQUEST_PATH: "/" REQUEST_URI: "http://localhost:3000/products" SCRIPT_NAME: "" SERVER_NAME: "localhost" SERVER_PORT: "3000" SERVER_PROTOCOL: "HTTP/1.1" SERVER_SOFTWARE: "WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)" action_controller.instance: #<ProductsController:0x7f722da308d0 @lookup_context=#<ActionView::LookupContext:0x7f722da303d0 @view_paths=[#<ActionView::FileSystemResolver:0x7f722ef995a0 @cached={}, @path="/home/rubys/git/awdwr/edition4/work-30/depot/app/views", @caching=false>], @details_key=#<ActionView::LookupContext::DetailsKey:0x7f722d7f63a8 @hash=70064183161300>, @skip_default_locale=false, @details={:handlers=>[:builder, :rjs, :erb, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]}, @frozen_formats=true>, @_headers={"Content-Type"=>"text/html"}, @view_context_class=nil, @_env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f722f06f2e0 @symbol=:html, @string="text/html", @synonyms=["application/xhtml+xml"]>], "action_dispatch.request.parameters"=>{"action"=>"index", "controller"=>"products"}, "rack.session"=>{"_csrf_token"=>"XfBkHT3bi21zPDXz4/aaqukTv2yc783VZwcBDNHbDWE=", "session_id"=>"6f8035ed41e1d1979f63f558302a290d", "cart_id"=>3}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_depot_session"=>"BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f722dab3eb0 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.unsigned_session_cookie"=>{"_csrf_token"=>"XfBkHT3bi21zPDXz4/aaqukTv2yc783VZwcBDNHbDWE=", "session_id"=>"6f8035ed41e1d1979f63f558302a290d", "cart_id"=>3}, "rack.errors"=>#<IO:0x7f72334d4ac0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f722f06f2e0 @symbol=:html, @string="text/html", @synonyms=["application/xhtml+xml"]>], "action_dispatch.secret_token"=>"bfb1db3c00dbefb2c1385a5cb6f0ada125a284e826c9838c575d213b8ed879c75ac08564c58eab49535f5233d9f52b1946394890cbb80fcff264aa75bc3cd0f6", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/products", "action_dispatch.request.path_parameters"=>{:action=>"index", :controller=>"products"}, "rack.request.cookie_string"=>"_depot_session=BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_depot_session=BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "action_dispatch.cookies"=>{"HttpOnly"=>nil, "_depot_session"=>"BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76", "path"=>"/"}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/products", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<ProductsController:0x7f722da308d0 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :expire_after=>nil, :id=>"6f8035ed41e1d1979f63f558302a290d", :domain=>nil, :path=>"/"}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f722dab4dd8>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @action_has_layout=true, @_action_name="index", @products=[#<Product id: 2, title: "CoffeeScript", description: "<p>\n CoffeeScript is JavaScript done right. ...", image_url: "/images/cs.jpg", price: #<BigDecimal:7f722d78bda0,'0.36E2',9(18)>, created_at: "2012-06-29 16:29:59", updated_at: "2012-06-29 16:29:59">, #<Product id: 3, title: "Programming Ruby 1.9", description: "<p>\n Ruby is the fastest growing and most ex...", image_url: "/images/ruby.jpg", price: #<BigDecimal:7f722d78ae78,'0.4995E2',18(18)>, created_at: "2012-06-29 16:29:59", updated_at: "2012-06-29 16:29:59">, #<Product id: 4, title: "Rails Test Prescriptions", description: "<p>\n <em>Rails Test Prescriptions</em> is a ...", image_url: "/images/rtp.jpg", price: #<BigDecimal:7f722d789f50,'0.3495E2',18(18)>, created_at: "2012-06-29 16:29:59", updated_at: "2012-06-29 16:29:59">], @_config=#<OrderedHash {}>, @_response=#<ActionDispatch::Response:0x7f722da30740 @cookie=[], @header={}, @status=200, @request=#<ActionDispatch::Request:0x7f722da30808 @request_method="GET", @method="GET", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f722f06f2e0 @symbol=:html, @string="text/html", @synonyms=["application/xhtml+xml"]>], "action_dispatch.request.parameters"=>{"action"=>"index", "controller"=>"products"}, "rack.session"=>{"_csrf_token"=>"XfBkHT3bi21zPDXz4/aaqukTv2yc783VZwcBDNHbDWE=", "session_id"=>"6f8035ed41e1d1979f63f558302a290d", "cart_id"=>3}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_depot_session"=>"BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f722dab3eb0 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.unsigned_session_cookie"=>{"_csrf_token"=>"XfBkHT3bi21zPDXz4/aaqukTv2yc783VZwcBDNHbDWE=", "session_id"=>"6f8035ed41e1d1979f63f558302a290d", "cart_id"=>3}, "rack.errors"=>#<IO:0x7f72334d4ac0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f722f06f2e0 @symbol=:html, @string="text/html", @synonyms=["application/xhtml+xml"]>], "action_dispatch.secret_token"=>"bfb1db3c00dbefb2c1385a5cb6f0ada125a284e826c9838c575d213b8ed879c75ac08564c58eab49535f5233d9f52b1946394890cbb80fcff264aa75bc3cd0f6", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/products", "action_dispatch.request.path_parameters"=>{:action=>"index", :controller=>"products"}, "rack.request.cookie_string"=>"_depot_session=BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_depot_session=BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "action_dispatch.cookies"=>{"HttpOnly"=>nil, "_depot_session"=>"BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76", "path"=>"/"}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/products", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<ProductsController:0x7f722da308d0 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :expire_after=>nil, :id=>"6f8035ed41e1d1979f63f558302a290d", :domain=>nil, :path=>"/"}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f722dab4dd8>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @filtered_parameters={"action"=>"index", "controller"=>"products"}, @symbolized_path_params={:action=>"index", :controller=>"products"}, @fullpath="/products">, @body=[], @length=0, @content_type="text/html", @etag=nil, @block=nil, @writer=#<Proc:0x00007f722f226ed0@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @blank=false, @sending_file=false, @cache_control={}>, @_status=200, @_response_body=nil, @_request=#<ActionDispatch::Request:0x7f722da30808 @request_method="GET", @method="GET", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f722f06f2e0 @symbol=:html, @string="text/html", @synonyms=["application/xhtml+xml"]>], "action_dispatch.request.parameters"=>{"action"=>"index", "controller"=>"products"}, "rack.session"=>{"_csrf_token"=>"XfBkHT3bi21zPDXz4/aaqukTv2yc783VZwcBDNHbDWE=", "session_id"=>"6f8035ed41e1d1979f63f558302a290d", "cart_id"=>3}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_depot_session"=>"BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f722dab3eb0 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.unsigned_session_cookie"=>{"_csrf_token"=>"XfBkHT3bi21zPDXz4/aaqukTv2yc783VZwcBDNHbDWE=", "session_id"=>"6f8035ed41e1d1979f63f558302a290d", "cart_id"=>3}, "rack.errors"=>#<IO:0x7f72334d4ac0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f722f06f2e0 @symbol=:html, @string="text/html", @synonyms=["application/xhtml+xml"]>], "action_dispatch.secret_token"=>"bfb1db3c00dbefb2c1385a5cb6f0ada125a284e826c9838c575d213b8ed879c75ac08564c58eab49535f5233d9f52b1946394890cbb80fcff264aa75bc3cd0f6", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/products", "action_dispatch.request.path_parameters"=>{:action=>"index", :controller=>"products"}, "rack.request.cookie_string"=>"_depot_session=BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_depot_session=BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "action_dispatch.cookies"=>{"HttpOnly"=>nil, "_depot_session"=>"BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76", "path"=>"/"}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/products", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<ProductsController:0x7f722da308d0 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :expire_after=>nil, :id=>"6f8035ed41e1d1979f63f558302a290d", :domain=>nil, :path=>"/"}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f722dab4dd8>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @filtered_parameters={"action"=>"index", "controller"=>"products"}, @symbolized_path_params={:action=>"index", :controller=>"products"}, @fullpath="/products">> action_dispatch.cookies: {"HttpOnly"=>nil, "_depot_session"=>"BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76", "path"=>"/"} action_dispatch.parameter_filter: [:password] action_dispatch.remote_ip: #<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f722dab3eb0 @check_ip_spoofing=true, @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f722f06f2e0 @symbol=:html, @string="text/html", @synonyms=["application/xhtml+xml"]>], "action_dispatch.request.parameters"=>{"action"=>"index", "controller"=>"products"}, "rack.session"=>{"_csrf_token"=>"XfBkHT3bi21zPDXz4/aaqukTv2yc783VZwcBDNHbDWE=", "session_id"=>"6f8035ed41e1d1979f63f558302a290d", "cart_id"=>3}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_depot_session"=>"BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f722dab3eb0 ...>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.unsigned_session_cookie"=>{"_csrf_token"=>"XfBkHT3bi21zPDXz4/aaqukTv2yc783VZwcBDNHbDWE=", "session_id"=>"6f8035ed41e1d1979f63f558302a290d", "cart_id"=>3}, "rack.errors"=>#<IO:0x7f72334d4ac0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f722f06f2e0 @symbol=:html, @string="text/html", @synonyms=["application/xhtml+xml"]>], "action_dispatch.secret_token"=>"bfb1db3c00dbefb2c1385a5cb6f0ada125a284e826c9838c575d213b8ed879c75ac08564c58eab49535f5233d9f52b1946394890cbb80fcff264aa75bc3cd0f6", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/products", "action_dispatch.request.path_parameters"=>{:action=>"index", :controller=>"products"}, "rack.request.cookie_string"=>"_depot_session=BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_depot_session=BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "action_dispatch.cookies"=>{"HttpOnly"=>nil, "_depot_session"=>"BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76", "path"=>"/"}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/products", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<ProductsController:0x7f722da308d0 @lookup_context=#<ActionView::LookupContext:0x7f722da303d0 @view_paths=[#<ActionView::FileSystemResolver:0x7f722ef995a0 @cached={}, @path="/home/rubys/git/awdwr/edition4/work-30/depot/app/views", @caching=false>], @details_key=#<ActionView::LookupContext::DetailsKey:0x7f722d7f63a8 @hash=70064183161300>, @skip_default_locale=false, @details={:handlers=>[:builder, :rjs, :erb, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]}, @frozen_formats=true>, @_headers={"Content-Type"=>"text/html"}, @view_context_class=nil, @_env={...}, @action_has_layout=true, @_action_name="index", @products=[#<Product id: 2, title: "CoffeeScript", description: "<p>\n CoffeeScript is JavaScript done right. ...", image_url: "/images/cs.jpg", price: #<BigDecimal:7f722d783b00,'0.36E2',9(18)>, created_at: "2012-06-29 16:29:59", updated_at: "2012-06-29 16:29:59">, #<Product id: 3, title: "Programming Ruby 1.9", description: "<p>\n Ruby is the fastest growing and most ex...", image_url: "/images/ruby.jpg", price: #<BigDecimal:7f722d783060,'0.4995E2',18(18)>, created_at: "2012-06-29 16:29:59", updated_at: "2012-06-29 16:29:59">, #<Product id: 4, title: "Rails Test Prescriptions", description: "<p>\n <em>Rails Test Prescriptions</em> is a ...", image_url: "/images/rtp.jpg", price: #<BigDecimal:7f722d782728,'0.3495E2',18(18)>, created_at: "2012-06-29 16:29:59", updated_at: "2012-06-29 16:29:59">], @_config=#<OrderedHash {}>, @_response=#<ActionDispatch::Response:0x7f722da30740 @cookie=[], @header={}, @status=200, @request=#<ActionDispatch::Request:0x7f722da30808 @request_method="GET", @method="GET", @env={...}, @filtered_parameters={"action"=>"index", "controller"=>"products"}, @symbolized_path_params={:action=>"index", :controller=>"products"}, @fullpath="/products">, @body=[], @length=0, @content_type="text/html", @etag=nil, @block=nil, @writer=#<Proc:0x00007f722f226ed0@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @blank=false, @sending_file=false, @cache_control={}>, @_status=200, @_response_body=nil, @_request=#<ActionDispatch::Request:0x7f722da30808 @request_method="GET", @method="GET", @env={...}, @filtered_parameters={"action"=>"index", "controller"=>"products"}, @symbolized_path_params={:action=>"index", :controller=>"products"}, @fullpath="/products">>, "rack.session.options"=>{:httponly=>true, :secure=>false, :expire_after=>nil, :id=>"6f8035ed41e1d1979f63f558302a290d", :domain=>nil, :path=>"/"}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f722dab4dd8>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i> action_dispatch.request.accepts: [#<Mime::Type:0x7f722f06f2e0 @symbol=:html, @string="text/html", @synonyms=["application/xhtml+xml"]>] action_dispatch.request.content_type: nil action_dispatch.request.formats: [#<Mime::Type:0x7f722f06f2e0 @symbol=:html, @string="text/html", @synonyms=["application/xhtml+xml"]>] action_dispatch.request.parameters: {"action"=>"index", "controller"=>"products"} action_dispatch.request.path_parameters: {:action=>"index", :controller=>"products"} action_dispatch.request.query_parameters: {} action_dispatch.request.request_parameters: {} action_dispatch.request.unsigned_session_cookie: {"_csrf_token"=>"XfBkHT3bi21zPDXz4/aaqukTv2yc783VZwcBDNHbDWE=", "session_id"=>"6f8035ed41e1d1979f63f558302a290d", "cart_id"=>3} action_dispatch.secret_token: "bfb1db3c00dbefb2c1385a5cb6f0ada125a284e826c9838c575d213b8ed879c75ac08564c58eab49535f5233d9f52b1946394890cbb80fcff264aa75bc3cd0f6" action_dispatch.show_exceptions: true rack.errors: #<IO:0x7f72334d4ac0> rack.input: #<StringIO:0x7f722dab4dd8> rack.multiprocess: false rack.multithread: false rack.request.cookie_hash: {"HttpOnly"=>nil, "_depot_session"=>"BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76", "path"=>"/"} rack.request.cookie_string: "_depot_session=BAh7CCIQX2NzcmZfdG9rZW4iMVhmQmtIVDNiaTIxelBEWHo0L2FhcXVrVHYyeWM3ODNWWndjQkROSGJEV0U9Ig9zZXNzaW9uX2lkIiU2ZjgwMzVlZDQxZTFkMTk3OWY2M2Y1NTgzMDJhMjkwZCIMY2FydF9pZGkI--407c5b7ae54394a4186c3ff9254047409afe3b76; path=/; HttpOnly" rack.request.query_hash: {} rack.request.query_string: "" rack.run_once: false rack.session: {"_csrf_token"=>"XfBkHT3bi21zPDXz4/aaqukTv2yc783VZwcBDNHbDWE=", "session_id"=>"6f8035ed41e1d1979f63f558302a290d", "cart_id"=>3} rack.session.options: {:httponly=>true, :secure=>false, :expire_after=>nil, :id=>"6f8035ed41e1d1979f63f558302a290d", :domain=>nil, :path=>"/"} rack.url_scheme: "http" rack.version: [1, 1]
Headers:
None
Conditionally display the cart.
edit app/views/layouts/application.html.erb
<% if @cart %>
<%= hidden_div_if(@cart.line_items.empty?, :id => 'cart') do %>
<%= render @cart %>
<% end %>
<% end %>
Update the redirect test.
edit test/functional/line_items_controller_test.rb
test "should create line_item" do
assert_difference('LineItem.count') do
post :create, :product_id => products(:ruby).id
end
assert_redirected_to store_path
end
Add an XHR test.
edit test/functional/line_items_controller_test.rb
test "should create line_item via ajax" do
assert_difference('LineItem.count') do
xhr :post, :create, :product_id => products(:ruby).id
end
assert_response :success
assert_select_rjs :replace_html, 'cart' do
assert_select 'tr#current_item td', /Programming Ruby 1.9/
end
end
Add an test in support for the coffeescript changes.
edit test/functional/store_controller_test.rb
test "markup needed for store.js.coffee is in place" do
get :index
assert_select '.store .entry > img', 3
assert_select '.entry input[type=submit]', 3
end
Run the tests again.
rake test
Loaded suite /home/rubys/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/rake_test_loader
Started
........
Finished in 0.418402 seconds.
8 tests, 29 assertions, 0 failures, 0 errors
Loaded suite /home/rubys/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/rake_test_loader
Started
.........................
Finished in 1.078228 seconds.
25 tests, 43 assertions, 0 failures, 0 errors
Save our progress
git commit -a -m "AJAX"
[master 16462d6] AJAX
3 files changed, 42 insertions(+), 11 deletions(-)
git tag iteration-f
12.1 Iteration G1: Capturing an Order 11.4 Iteration F4: Hide an Empty Cart