12.1 Generating the XML Feed 11.3 Iteration F3: Limiting Access
edit app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
layout "store"
#...
get /admin
Showing /home/rubys/git/awdwr/edition3/work-30/depot/app/views/layouts/store.html.erb where line #24 raised:
undefined method `items' for nil:NilClass
Extracted source (around line #24):
21: <div id="side">
22: <!-- START_HIGHLIGHT -->
23: <!-- START:hidden_div -->
24: <%= hidden_div_if(@cart.items.empty?, :id => 'cart') do %>
25: <%= render(:partial => "cart", :object => @cart) %>
26: <% end %>
27: <!-- END:hidden_div -->
Rails.root: /home/rubys/git/awdwr/edition3/work-30/depot
app/views/layouts/store.html.erb:24:in `_app_views_layouts_store_html_erb__1288381055_69959686326780_0'
/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/implicit_render.rb:5: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:441:in `_run__22524425__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:89: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/store.html.erb:24:in `_app_views_layouts_store_html_erb__1288381055_69959686326780_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/implicit_render.rb:5: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:441:in `_run__22524425__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:89: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: "7pmaGzEjQ20WKJ7jNAkI8Q9rA9a07u6lyv7t0ndvIGM=" cart: #<Cart:0x7f4184915628 @items=[]> user_id: 1
GATEWAY_INTERFACE: "CGI/1.1" HTTP_ACCEPT: "text/html" HTTP_COOKIE: "_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly" HTTP_HOST: "localhost:3000" HTTP_VERSION: "HTTP/1.1" PATH_INFO: "/admin" QUERY_STRING: "" REMOTE_ADDR: "127.0.0.1" REMOTE_HOST: "localhost" REQUEST_METHOD: "GET" REQUEST_PATH: "/" REQUEST_URI: "http://localhost:3000/admin" 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: #<AdminController:0x7f41848a5b98 @view_context_class=nil, @action_has_layout=true, @_action_name="index", @_env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"index", "controller"=>"admin"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7CCIQX2NzcmZfdG9rZW4iMTdwbWFHekVqUTIwV0tKN2pOQWt...", created_at: "2012-06-29 19:13:10", updated_at: "2012-06-29 19:13:14">, "rack.session"=>{"_csrf_token"=>"7pmaGzEjQ20WKJ7jNAkI8Q9rA9a07u6lyv7t0ndvIGM=", "cart"=>#<Cart:0x7f4184915628 @items=[]>, "user_id"=>1}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f418493a298 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/admin", "action_dispatch.request.path_parameters"=>{:action=>"index", :controller=>"admin"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/admin", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<AdminController:0x7f41848a5b98 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f418493b210>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @_config=#<OrderedHash {}>, @_response=#<ActionDispatch::Response:0x7f41848a5a08 @cookie=[], @header={}, @status=200, @request=#<ActionDispatch::Request:0x7f41848a5ad0 @request_method="GET", @method="GET", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"index", "controller"=>"admin"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7CCIQX2NzcmZfdG9rZW4iMTdwbWFHekVqUTIwV0tKN2pOQWt...", created_at: "2012-06-29 19:13:10", updated_at: "2012-06-29 19:13:14">, "rack.session"=>{"_csrf_token"=>"7pmaGzEjQ20WKJ7jNAkI8Q9rA9a07u6lyv7t0ndvIGM=", "cart"=>#<Cart:0x7f4184915628 @items=[]>, "user_id"=>1}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f418493a298 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/admin", "action_dispatch.request.path_parameters"=>{:action=>"index", :controller=>"admin"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/admin", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<AdminController:0x7f41848a5b98 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f418493b210>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @filtered_parameters={"action"=>"index", "controller"=>"admin"}, @fullpath="/admin">, @body=[], @length=0, @etag=nil, @block=nil, @writer=#<Proc:0x00007f41861f8fa0@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @blank=false, @sending_file=false, @cache_control={}>, @_status=200, @_response_body=nil, @total_orders=1, @_request=#<ActionDispatch::Request:0x7f41848a5ad0 @request_method="GET", @method="GET", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"index", "controller"=>"admin"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7CCIQX2NzcmZfdG9rZW4iMTdwbWFHekVqUTIwV0tKN2pOQWt...", created_at: "2012-06-29 19:13:10", updated_at: "2012-06-29 19:13:14">, "rack.session"=>{"_csrf_token"=>"7pmaGzEjQ20WKJ7jNAkI8Q9rA9a07u6lyv7t0ndvIGM=", "cart"=>#<Cart:0x7f4184915628 @items=[]>, "user_id"=>1}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f418493a298 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/admin", "action_dispatch.request.path_parameters"=>{:action=>"index", :controller=>"admin"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/admin", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<AdminController:0x7f41848a5b98 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f418493b210>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @filtered_parameters={"action"=>"index", "controller"=>"admin"}, @fullpath="/admin">, @lookup_context=#<ActionView::LookupContext:0x7f41848a5698 @view_paths=[#<ActionView::FileSystemResolver:0x7f41849fecd8 @caching=false, @cached={}, @path="/home/rubys/git/awdwr/edition3/work-30/depot/app/views">], @details_key=#<ActionView::LookupContext::DetailsKey:0x7f4184746388 @hash=69959685910980>, @skip_default_locale=false, @details={:handlers=>[:rxml, :builder, :rjs, :erb, :rhtml], :formats=>[:html], :locale=>[:en, :en]}, @frozen_formats=true>, @_headers={"Content-Type"=>"text/html"}> action_dispatch.parameter_filter: [:password] action_dispatch.remote_ip: #<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f418493a298 @check_ip_spoofing=true, @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"index", "controller"=>"admin"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7CCIQX2NzcmZfdG9rZW4iMTdwbWFHekVqUTIwV0tKN2pOQWt...", created_at: "2012-06-29 19:13:10", updated_at: "2012-06-29 19:13:14">, "rack.session"=>{"_csrf_token"=>"7pmaGzEjQ20WKJ7jNAkI8Q9rA9a07u6lyv7t0ndvIGM=", "cart"=>#<Cart:0x7f4184915628 @items=[]>, "user_id"=>1}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f418493a298 ...>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/admin", "action_dispatch.request.path_parameters"=>{:action=>"index", :controller=>"admin"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/admin", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<AdminController:0x7f41848a5b98 @view_context_class=nil, @action_has_layout=true, @_action_name="index", @_env={...}, @_config=#<OrderedHash {}>, @_response=#<ActionDispatch::Response:0x7f41848a5a08 @cookie=[], @header={}, @status=200, @request=#<ActionDispatch::Request:0x7f41848a5ad0 @request_method="GET", @method="GET", @env={...}, @filtered_parameters={"action"=>"index", "controller"=>"admin"}, @fullpath="/admin">, @body=[], @length=0, @etag=nil, @block=nil, @writer=#<Proc:0x00007f41861f8fa0@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @blank=false, @sending_file=false, @cache_control={}>, @_status=200, @_response_body=nil, @total_orders=1, @_request=#<ActionDispatch::Request:0x7f41848a5ad0 @request_method="GET", @method="GET", @env={...}, @filtered_parameters={"action"=>"index", "controller"=>"admin"}, @fullpath="/admin">, @lookup_context=#<ActionView::LookupContext:0x7f41848a5698 @view_paths=[#<ActionView::FileSystemResolver:0x7f41849fecd8 @caching=false, @cached={}, @path="/home/rubys/git/awdwr/edition3/work-30/depot/app/views">], @details_key=#<ActionView::LookupContext::DetailsKey:0x7f4184746388 @hash=69959685910980>, @skip_default_locale=false, @details={:handlers=>[:rxml, :builder, :rjs, :erb, :rhtml], :formats=>[:html], :locale=>[:en, :en]}, @frozen_formats=true>, @_headers={"Content-Type"=>"text/html"}>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f418493b210>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i> action_dispatch.request.accepts: [#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">] action_dispatch.request.content_type: nil action_dispatch.request.formats: [#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">] action_dispatch.request.parameters: {"action"=>"index", "controller"=>"admin"} action_dispatch.request.path_parameters: {:action=>"index", :controller=>"admin"} action_dispatch.request.query_parameters: {} action_dispatch.request.request_parameters: {} action_dispatch.secret_token: "7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc" action_dispatch.show_exceptions: true rack.errors: #<IO:0x7f418a4a5ab0> rack.input: #<StringIO:0x7f418493b210> rack.multiprocess: false rack.multithread: false rack.request.cookie_hash: {"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"} rack.request.cookie_string: "_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly" rack.request.query_hash: {} rack.request.query_string: "" rack.run_once: false rack.session: {"_csrf_token"=>"7pmaGzEjQ20WKJ7jNAkI8Q9rA9a07u6lyv7t0ndvIGM=", "cart"=>#<Cart:0x7f4184915628 @items=[]>, "user_id"=>1} rack.session.options: {:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil} rack.session.record: #<ActiveRecord::SessionStore::Session id: 3, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7CCIQX2NzcmZfdG9rZW4iMTdwbWFHekVqUTIwV0tKN2pOQWt...", created_at: "2012-06-29 19:13:10", updated_at: "2012-06-29 19:13:14"> rack.url_scheme: "http" rack.version: [1, 1]
Headers:
None
get /users
Showing /home/rubys/git/awdwr/edition3/work-30/depot/app/views/layouts/store.html.erb where line #24 raised:
undefined method `items' for nil:NilClass
Extracted source (around line #24):
21: <div id="side">
22: <!-- START_HIGHLIGHT -->
23: <!-- START:hidden_div -->
24: <%= hidden_div_if(@cart.items.empty?, :id => 'cart') do %>
25: <%= render(:partial => "cart", :object => @cart) %>
26: <% end %>
27: <!-- END:hidden_div -->
Rails.root: /home/rubys/git/awdwr/edition3/work-30/depot
app/views/layouts/store.html.erb:24:in `_app_views_layouts_store_html_erb__1288381055_69959687707580_0'
app/controllers/users_controller.rb:9: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:441:in `_run__434435962__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/store.html.erb:24:in `_app_views_layouts_store_html_erb__1288381055_69959687707580_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/users_controller.rb:9: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:441:in `_run__434435962__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: "7pmaGzEjQ20WKJ7jNAkI8Q9rA9a07u6lyv7t0ndvIGM=" cart: #<Cart:0x7f41846aaf00 @items=[]> user_id: 1
GATEWAY_INTERFACE: "CGI/1.1" HTTP_ACCEPT: "text/html" HTTP_COOKIE: "_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly" HTTP_HOST: "localhost:3000" HTTP_VERSION: "HTTP/1.1" PATH_INFO: "/users" QUERY_STRING: "" REMOTE_ADDR: "127.0.0.1" REMOTE_HOST: "localhost" REQUEST_METHOD: "GET" REQUEST_PATH: "/" REQUEST_URI: "http://localhost:3000/users" 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: #<UsersController:0x7f4184b1c520 @view_context_class=nil, @users=[#<User id: 1, name: "dave", hashed_password: "9e4c1e8686d59c5202142be0054001a6f0ba8d53", salt: "699596864246000.628262038194712", created_at: "2012-06-29 19:12:58", updated_at: "2012-06-29 19:12:58">], @action_has_layout=true, @_action_name="index", @_env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"index", "controller"=>"users"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7CCIQX2NzcmZfdG9rZW4iMTdwbWFHekVqUTIwV0tKN2pOQWt...", created_at: "2012-06-29 19:13:10", updated_at: "2012-06-29 19:13:14">, "rack.session"=>{"_csrf_token"=>"7pmaGzEjQ20WKJ7jNAkI8Q9rA9a07u6lyv7t0ndvIGM=", "cart"=>#<Cart:0x7f41846aaf00 @items=[]>, "user_id"=>1}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f41846c5738 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/users", "action_dispatch.request.path_parameters"=>{:action=>"index", :controller=>"users"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/users", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<UsersController:0x7f4184b1c520 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "action_dispatch.request.flash_hash"=>{}, "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f41846c68b8>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @_config=#<OrderedHash {}>, @_response=#<ActionDispatch::Response:0x7f4184b1c390 @cookie=[], @header={}, @status=200, @request=#<ActionDispatch::Request:0x7f4184b1c458 @request_method="GET", @method="GET", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"index", "controller"=>"users"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7CCIQX2NzcmZfdG9rZW4iMTdwbWFHekVqUTIwV0tKN2pOQWt...", created_at: "2012-06-29 19:13:10", updated_at: "2012-06-29 19:13:14">, "rack.session"=>{"_csrf_token"=>"7pmaGzEjQ20WKJ7jNAkI8Q9rA9a07u6lyv7t0ndvIGM=", "cart"=>#<Cart:0x7f41846aaf00 @items=[]>, "user_id"=>1}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f41846c5738 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/users", "action_dispatch.request.path_parameters"=>{:action=>"index", :controller=>"users"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/users", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<UsersController:0x7f4184b1c520 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "action_dispatch.request.flash_hash"=>{}, "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f41846c68b8>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @filtered_parameters={"action"=>"index", "controller"=>"users"}, @symbolized_path_params={:action=>"index", :controller=>"users"}, @fullpath="/users">, @body=[], @length=0, @content_type="text/html", @etag=nil, @block=nil, @writer=#<Proc:0x00007f41861f8fa0@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @blank=false, @sending_file=false, @cache_control={}>, @_status=200, @_response_body=nil, @_request=#<ActionDispatch::Request:0x7f4184b1c458 @request_method="GET", @method="GET", @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"index", "controller"=>"users"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7CCIQX2NzcmZfdG9rZW4iMTdwbWFHekVqUTIwV0tKN2pOQWt...", created_at: "2012-06-29 19:13:10", updated_at: "2012-06-29 19:13:14">, "rack.session"=>{"_csrf_token"=>"7pmaGzEjQ20WKJ7jNAkI8Q9rA9a07u6lyv7t0ndvIGM=", "cart"=>#<Cart:0x7f41846aaf00 @items=[]>, "user_id"=>1}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f41846c5738 @check_ip_spoofing=true, @env={...}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/users", "action_dispatch.request.path_parameters"=>{:action=>"index", :controller=>"users"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/users", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<UsersController:0x7f4184b1c520 ...>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "action_dispatch.request.flash_hash"=>{}, "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f41846c68b8>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @filtered_parameters={"action"=>"index", "controller"=>"users"}, @symbolized_path_params={:action=>"index", :controller=>"users"}, @fullpath="/users">, @lookup_context=#<ActionView::LookupContext:0x7f4184b1c020 @view_paths=[#<ActionView::FileSystemResolver:0x7f41849fecd8 @caching=false, @cached={}, @path="/home/rubys/git/awdwr/edition3/work-30/depot/app/views">], @details_key=#<ActionView::LookupContext::DetailsKey:0x7f4184746388 @hash=69959685910980>, @skip_default_locale=false, @details={:handlers=>[:rxml, :builder, :rjs, :erb, :rhtml], :formats=>[:html], :locale=>[:en, :en]}, @frozen_formats=true>, @_headers={"Content-Type"=>"text/html"}> action_dispatch.parameter_filter: [:password] action_dispatch.remote_ip: #<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f41846c5738 @check_ip_spoofing=true, @env={"action_dispatch.request.formats"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.request.parameters"=>{"action"=>"index", "controller"=>"users"}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7CCIQX2NzcmZfdG9rZW4iMTdwbWFHekVqUTIwV0tKN2pOQWt...", created_at: "2012-06-29 19:13:10", updated_at: "2012-06-29 19:13:14">, "rack.session"=>{"_csrf_token"=>"7pmaGzEjQ20WKJ7jNAkI8Q9rA9a07u6lyv7t0ndvIGM=", "cart"=>#<Cart:0x7f41846aaf00 @items=[]>, "user_id"=>1}, "HTTP_HOST"=>"localhost:3000", "HTTP_ACCEPT"=>"text/html", "SERVER_NAME"=>"localhost", "rack.request.cookie_hash"=>{"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"}, "action_dispatch.remote_ip"=>#<ActionDispatch::RemoteIp::RemoteIpGetter:0x7f41846c5738 ...>, "REQUEST_PATH"=>"/", "rack.url_scheme"=>"http", "REMOTE_HOST"=>"localhost", "action_dispatch.request.query_parameters"=>{}, "rack.errors"=>#<IO:0x7f418a4a5ab0>, "SERVER_PROTOCOL"=>"HTTP/1.1", "action_dispatch.request.accepts"=>[#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">], "action_dispatch.secret_token"=>"7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc", "rack.version"=>[1, 1], "rack.run_once"=>false, "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)", "REMOTE_ADDR"=>"127.0.0.1", "PATH_INFO"=>"/users", "action_dispatch.request.path_parameters"=>{:action=>"index", :controller=>"users"}, "rack.request.cookie_string"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "SCRIPT_NAME"=>"", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.show_exceptions"=>true, "HTTP_VERSION"=>"HTTP/1.1", "rack.multithread"=>false, "HTTP_COOKIE"=>"_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly", "action_dispatch.request.request_parameters"=>{}, "rack.multiprocess"=>false, "REQUEST_URI"=>"http://localhost:3000/users", "rack.request.query_hash"=>{}, "SERVER_PORT"=>"3000", "action_controller.instance"=>#<UsersController:0x7f4184b1c520 @view_context_class=nil, @users=[#<User id: 1, name: "dave", hashed_password: "9e4c1e8686d59c5202142be0054001a6f0ba8d53", salt: "699596864246000.628262038194712", created_at: "2012-06-29 19:12:58", updated_at: "2012-06-29 19:12:58">], @action_has_layout=true, @_action_name="index", @_env={...}, @_config=#<OrderedHash {}>, @_response=#<ActionDispatch::Response:0x7f4184b1c390 @cookie=[], @header={}, @status=200, @request=#<ActionDispatch::Request:0x7f4184b1c458 @request_method="GET", @method="GET", @env={...}, @filtered_parameters={"action"=>"index", "controller"=>"users"}, @symbolized_path_params={:action=>"index", :controller=>"users"}, @fullpath="/users">, @body=[], @length=0, @content_type="text/html", @etag=nil, @block=nil, @writer=#<Proc:0x00007f41861f8fa0@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43>, @blank=false, @sending_file=false, @cache_control={}>, @_status=200, @_response_body=nil, @_request=#<ActionDispatch::Request:0x7f4184b1c458 @request_method="GET", @method="GET", @env={...}, @filtered_parameters={"action"=>"index", "controller"=>"users"}, @symbolized_path_params={:action=>"index", :controller=>"users"}, @fullpath="/users">, @lookup_context=#<ActionView::LookupContext:0x7f4184b1c020 @view_paths=[#<ActionView::FileSystemResolver:0x7f41849fecd8 @caching=false, @cached={}, @path="/home/rubys/git/awdwr/edition3/work-30/depot/app/views">], @details_key=#<ActionView::LookupContext::DetailsKey:0x7f4184746388 @hash=69959685910980>, @skip_default_locale=false, @details={:handlers=>[:rxml, :builder, :rjs, :erb, :rhtml], :formats=>[:html], :locale=>[:en, :en]}, @frozen_formats=true>, @_headers={"Content-Type"=>"text/html"}>, "rack.session.options"=>{:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil}, "REQUEST_METHOD"=>"GET", "action_dispatch.request.flash_hash"=>{}, "rack.request.query_string"=>"", "action_dispatch.request.content_type"=>nil, "rack.input"=>#<StringIO:0x7f41846c68b8>, "QUERY_STRING"=>"", "GATEWAY_INTERFACE"=>"CGI/1.1"}, @trusted_proxies=/(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)/i> action_dispatch.request.accepts: [#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">] action_dispatch.request.content_type: nil action_dispatch.request.flash_hash: {} action_dispatch.request.formats: [#<Mime::Type:0x7f4186506260 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">] action_dispatch.request.parameters: {"action"=>"index", "controller"=>"users"} action_dispatch.request.path_parameters: {:action=>"index", :controller=>"users"} action_dispatch.request.query_parameters: {} action_dispatch.request.request_parameters: {} action_dispatch.secret_token: "7277c335a245f53322f97b4f8e7101f899c4d9a9abce8aa31c4d08bd1a7e48039c6cc2149fc74d1c6aa66c65c940399c646edadfbae9207febf149fe77e735dc" action_dispatch.show_exceptions: true rack.errors: #<IO:0x7f418a4a5ab0> rack.input: #<StringIO:0x7f41846c68b8> rack.multiprocess: false rack.multithread: false rack.request.cookie_hash: {"HttpOnly"=>nil, "_session_id"=>"010829f320442f9bc0caae81973047a2", "path"=>"/"} rack.request.cookie_string: "_session_id=010829f320442f9bc0caae81973047a2; path=/; HttpOnly" rack.request.query_hash: {} rack.request.query_string: "" rack.run_once: false rack.session: {"_csrf_token"=>"7pmaGzEjQ20WKJ7jNAkI8Q9rA9a07u6lyv7t0ndvIGM=", "cart"=>#<Cart:0x7f41846aaf00 @items=[]>, "user_id"=>1} rack.session.options: {:httponly=>true, :secure=>false, :id=>"010829f320442f9bc0caae81973047a2", :domain=>nil, :path=>"/", :expire_after=>nil} rack.session.record: #<ActiveRecord::SessionStore::Session id: 3, session_id: "010829f320442f9bc0caae81973047a2", data: "BAh7CCIQX2NzcmZfdG9rZW4iMTdwbWFHekVqUTIwV0tKN2pOQWt...", created_at: "2012-06-29 19:13:10", updated_at: "2012-06-29 19:13:14"> rack.url_scheme: "http" rack.version: [1, 1]
Headers:
None
edit app/views/layouts/store.html.erb
<% if @cart %>
<%= hidden_div_if(@cart.items.empty?, :id => 'cart') do %>
<%= render(:partial => "cart", :object => @cart) %>
<% end %>
<% end %>
get /admin
get /users
rm app/views/layouts/products.html.erb
rm: cannot remove `app/views/layouts/products.html.erb': No such file or directory
rm app/views/layouts/users.html.erb
rm: cannot remove `app/views/layouts/users.html.erb': No such file or directory
rm app/views/layouts/orders.html.erb
rm: cannot remove `app/views/layouts/orders.html.erb': No such file or directory
get /users
edit app/models/user.rb
require 'digest/sha1'
class User < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
attr_accessor :password_confirmation
validates_confirmation_of :password
validate :password_non_blank
def self.authenticate(name, password)
user = self.find_by_name(name)
if user
expected_password = encrypted_password(password, user.salt)
if user.hashed_password != expected_password
user = nil
end
end
user
end
# 'password' is a virtual attribute
def password
@password
end
def password=(pwd)
@password = pwd
return if pwd.blank?
create_new_salt
self.hashed_password = User.encrypted_password(self.password, self.salt)
end
after_destroy :ensure_an_admin_remains
def ensure_an_admin_remains
if User.count.zero?
raise "Can't delete last user"
end
end
private
def password_non_blank
errors.add(:password, "Missing password") if hashed_password.blank?
end
def create_new_salt
self.salt = self.object_id.to_s + rand.to_s
end
def self.encrypted_password(password, salt)
string_to_hash = password + "wibble" + salt
Digest::SHA1.hexdigest(string_to_hash)
end
end
edit app/controllers/users_controller.rb
class UsersController < ApplicationController
# GET /users
# GET /users.xml
def index
@users = User.all(:order => :name)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @users }
end
end
# GET /users/1
# GET /users/1.xml
def show
@user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @user }
end
end
# GET /users/new
# GET /users/new.xml
def new
@user = User.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @user }
end
end
# GET /users/1/edit
def edit
@user = User.find(params[:id])
end
# POST /users
# POST /users.xml
def create
@user = User.new(params[:user])
respond_to do |format|
if @user.save
format.html { redirect_to(users_url,
:notice => "User #{@user.name} was successfully created.") }
format.xml { render :xml => @user, :status => :created,
:location => @user }
else
format.html { render :action => "new" }
format.xml { render :xml => @user.errors,
:status => :unprocessable_entity }
end
end
end
# PUT /users/1
# PUT /users/1.xml
def update
@user = User.find(params[:id])
respond_to do |format|
if @user.update_attributes(params[:user])
format.html { redirect_to(users_url,
:notice => "User #{@user.name} was successfully updated.") }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @user.errors,
:status => :unprocessable_entity }
end
end
end
# DELETE /users/1
# DELETE /users/1.xml
def destroy
@user = User.find(params[:id])
begin
@user.destroy
flash[:notice] = "User #{@user.name} deleted"
rescue Exception => e
flash[:notice] = e.message
end
respond_to do |format|
format.html { redirect_to(users_url) }
format.xml { head :ok }
end
end
end
edit app/controllers/store_controller.rb
def find_cart
@cart = (session[:cart] ||= Cart.new)
end
edit app/controllers/store_controller.rb
before_filter :find_cart, :except => :empty_cart
echo "Product.new" | IRBRC=tmp/irbrc rails console
Loading development environment (Rails 3.0.15)
>> Product.new
=> #<Product id: nil, title: nil, description: nil, image_url: nil, created_at: nil, updated_at: nil, price: #<BigDecimal:7f57194b11b8,'0.0',9(18)>>
>>
12.1 Generating the XML Feed 11.3 Iteration F3: Limiting Access