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/work-193/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/work-193/depot
app/views/layouts/store.html.erb:24:in `_app_views_layouts_store_html_erb__126324977_75168580__616967263'
/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 `block 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:76:in `_render_layout'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:62:in `block in _render_template'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block 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:114:in `_render_template'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:108: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:101:in `render_to_string'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:92: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 `block (2 levels) in render'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/benchmark.rb:309: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 `block 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:148:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:435:in `_run__218604098__process_action__950352040__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:404:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:93:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block in instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:117:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:40:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:133:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:173:in `block in action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:89:in `block in recognize'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:66:in `optimized_each'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:88:in `recognize'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:492:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:8:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.1) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:177:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:268:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `block in call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:48:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
/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__126324977_75168580__616967263'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:135:in `block 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:76:in `_render_layout'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:62:in `block in _render_template'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block 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:114:in `_render_template'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:108: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:101:in `render_to_string'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:92: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 `block (2 levels) in render'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/benchmark.rb:309: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 `block 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:148:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:435:in `_run__218604098__process_action__950352040__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:404:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:93:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block in instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:117:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:40:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:133:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:173:in `block in action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:89:in `block in recognize'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:66:in `optimized_each'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:88:in `recognize'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:492:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:8:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.1) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:177:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:268:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `block in call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:48:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Parameters:
None
_csrf_token: "I4egdaGRvgeMzR7FA+7/IdzDI4lNWCSVEtfkvCGLpz4=" cart: #<Cart:0x929a280 @items=[]> user_id: 1
GATEWAY_INTERFACE: "CGI/1.1" HTTP_ACCEPT: "text/html" HTTP_COOKIE: "_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly" HTTP_HOST: "localhost:3000" HTTP_USER_AGENT: "Ruby" 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.9.3/2010-08-09)" action_controller.instance: #<AdminController:0x85a1aec @action_has_layout=true, @view_context_class=nil, @_headers={"Content-Type"=>"text/html"}, @_status=200, @_response=#<ActionDispatch::Response:0x85a1a24 @writer=#<Proc:0x85a1998@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:44 (lambda)>, @block=nil, @length=0, @header={}, @status=200, @body=[], @cookie=[], @sending_file=false, @blank=false, @cache_control={}, @etag=nil, @request=#<ActionDispatch::Request:0x85a1a38 @env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/admin", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "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.9.3/2010-08-09)", "HTTP_ACCEPT"=>"text/html", "HTTP_USER_AGENT"=>"Ruby", "HTTP_COOKIE"=>"_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly", "HTTP_HOST"=>"localhost:3000", "rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x92f9e9c>, "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.secret_token"=>"70af2f4a808fc9dcb674a466e5ac40287cc2e713d3b2a467ecea1a17c8728cb7b794940d6cd7b08d9b2666235e72da3de9439dab4818d3b5f3014032b1ad6092", "action_dispatch.remote_ip"=>127.0.0.1, "rack.session"=>{"_csrf_token"=>"I4egdaGRvgeMzR7FA+7/IdzDI4lNWCSVEtfkvCGLpz4=", "cart"=>#<Cart:0x929a280 @items=[]>, "user_id"=>1}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"e887829ba71c0003b81ab90e827c4c30"}, "rack.request.cookie_string"=>"_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly", "rack.request.cookie_hash"=>{"_session_id"=>"e887829ba71c0003b81ab90e827c4c30", "path"=>"/", "HttpOnly"=>nil}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "e887829ba71c0003b81ab90e827c4c30", data: "BAh7CEkiEF9jc3JmX3Rva2VuBjoGRUZJIjFJNGVnZGFHUnZnZU1...", created_at: "2010-08-08 16:22:38", updated_at: "2010-08-08 16:22:39">, "action_dispatch.request.path_parameters"=>{:controller=>"admin", :action=>"index"}, "action_controller.instance"=>#<AdminController:0x85a1aec ...>, "action_dispatch.request.content_type"=>nil, "action_dispatch.request.request_parameters"=>{}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.parameters"=>{"controller"=>"admin", "action"=>"index"}, "action_dispatch.request.accepts"=>[text/html], "action_dispatch.request.formats"=>[text/html]}, @fullpath="/admin", @request_method="GET", @filtered_parameters={"controller"=>"admin", "action"=>"index"}, @method="GET">>, @_request=#<ActionDispatch::Request:0x85a1a38 @env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/admin", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "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.9.3/2010-08-09)", "HTTP_ACCEPT"=>"text/html", "HTTP_USER_AGENT"=>"Ruby", "HTTP_COOKIE"=>"_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly", "HTTP_HOST"=>"localhost:3000", "rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x92f9e9c>, "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.secret_token"=>"70af2f4a808fc9dcb674a466e5ac40287cc2e713d3b2a467ecea1a17c8728cb7b794940d6cd7b08d9b2666235e72da3de9439dab4818d3b5f3014032b1ad6092", "action_dispatch.remote_ip"=>127.0.0.1, "rack.session"=>{"_csrf_token"=>"I4egdaGRvgeMzR7FA+7/IdzDI4lNWCSVEtfkvCGLpz4=", "cart"=>#<Cart:0x929a280 @items=[]>, "user_id"=>1}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"e887829ba71c0003b81ab90e827c4c30"}, "rack.request.cookie_string"=>"_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly", "rack.request.cookie_hash"=>{"_session_id"=>"e887829ba71c0003b81ab90e827c4c30", "path"=>"/", "HttpOnly"=>nil}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "e887829ba71c0003b81ab90e827c4c30", data: "BAh7CEkiEF9jc3JmX3Rva2VuBjoGRUZJIjFJNGVnZGFHUnZnZU1...", created_at: "2010-08-08 16:22:38", updated_at: "2010-08-08 16:22:39">, "action_dispatch.request.path_parameters"=>{:controller=>"admin", :action=>"index"}, "action_controller.instance"=>#<AdminController:0x85a1aec ...>, "action_dispatch.request.content_type"=>nil, "action_dispatch.request.request_parameters"=>{}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.parameters"=>{"controller"=>"admin", "action"=>"index"}, "action_dispatch.request.accepts"=>[text/html], "action_dispatch.request.formats"=>[text/html]}, @fullpath="/admin", @request_method="GET", @filtered_parameters={"controller"=>"admin", "action"=>"index"}, @method="GET">, @_env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/admin", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "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.9.3/2010-08-09)", "HTTP_ACCEPT"=>"text/html", "HTTP_USER_AGENT"=>"Ruby", "HTTP_COOKIE"=>"_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly", "HTTP_HOST"=>"localhost:3000", "rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x92f9e9c>, "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.secret_token"=>"70af2f4a808fc9dcb674a466e5ac40287cc2e713d3b2a467ecea1a17c8728cb7b794940d6cd7b08d9b2666235e72da3de9439dab4818d3b5f3014032b1ad6092", "action_dispatch.remote_ip"=>127.0.0.1, "rack.session"=>{"_csrf_token"=>"I4egdaGRvgeMzR7FA+7/IdzDI4lNWCSVEtfkvCGLpz4=", "cart"=>#<Cart:0x929a280 @items=[]>, "user_id"=>1}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"e887829ba71c0003b81ab90e827c4c30"}, "rack.request.cookie_string"=>"_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly", "rack.request.cookie_hash"=>{"_session_id"=>"e887829ba71c0003b81ab90e827c4c30", "path"=>"/", "HttpOnly"=>nil}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "e887829ba71c0003b81ab90e827c4c30", data: "BAh7CEkiEF9jc3JmX3Rva2VuBjoGRUZJIjFJNGVnZGFHUnZnZU1...", created_at: "2010-08-08 16:22:38", updated_at: "2010-08-08 16:22:39">, "action_dispatch.request.path_parameters"=>{:controller=>"admin", :action=>"index"}, "action_controller.instance"=>#<AdminController:0x85a1aec ...>, "action_dispatch.request.content_type"=>nil, "action_dispatch.request.request_parameters"=>{}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.parameters"=>{"controller"=>"admin", "action"=>"index"}, "action_dispatch.request.accepts"=>[text/html], "action_dispatch.request.formats"=>[text/html]}, @lookup_context=#<ActionView::LookupContext:0x85a0548 @details_key=#<ActionView::LookupContext::DetailsKey:0x8f17900 @hash=686566689>, @details={:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]}, @skip_default_locale=false, @frozen_formats=true, @view_paths=[/home/rubys/git/awdwr/work-193/depot/app/views]>, @_action_name="index", @_response_body=nil, @config={}, @total_orders=1> action_dispatch.parameter_filter: [:password] action_dispatch.remote_ip: 127.0.0.1 action_dispatch.request.accepts: [text/html] action_dispatch.request.content_type: nil action_dispatch.request.formats: [text/html] action_dispatch.request.parameters: {"controller"=>"admin", "action"=>"index"} action_dispatch.request.path_parameters: {:controller=>"admin", :action=>"index"} action_dispatch.request.query_parameters: {} action_dispatch.request.request_parameters: {} action_dispatch.secret_token: "70af2f4a808fc9dcb674a466e5ac40287cc2e713d3b2a467ecea1a17c8728cb7b794940d6cd7b08d9b2666235e72da3de9439dab4818d3b5f3014032b1ad6092" rack.errors: #<IO:<STDERR>> rack.input: #<StringIO:0x92f9e9c> rack.multiprocess: false rack.multithread: false rack.request.cookie_hash: {"_session_id"=>"e887829ba71c0003b81ab90e827c4c30", "path"=>"/", "HttpOnly"=>nil} rack.request.cookie_string: "_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly" rack.request.query_hash: {} rack.request.query_string: "" rack.run_once: false rack.session: {"_csrf_token"=>"I4egdaGRvgeMzR7FA+7/IdzDI4lNWCSVEtfkvCGLpz4=", "cart"=>#<Cart:0x929a280 @items=[]>, "user_id"=>1} rack.session.options: {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"e887829ba71c0003b81ab90e827c4c30"} rack.session.record: #<ActiveRecord::SessionStore::Session id: 3, session_id: "e887829ba71c0003b81ab90e827c4c30", data: "BAh7CEkiEF9jc3JmX3Rva2VuBjoGRUZJIjFJNGVnZGFHUnZnZU1...", created_at: "2010-08-08 16:22:38", updated_at: "2010-08-08 16:22:39"> rack.url_scheme: "http" rack.version: [1, 1]
Headers:
None
get /users
Showing /home/rubys/git/awdwr/work-193/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/work-193/depot
app/views/layouts/store.html.erb:24:in `_app_views_layouts_store_html_erb__126324977_77157520__616967263'
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 `block 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:76:in `_render_layout'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:62:in `block in _render_template'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block 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:114:in `_render_template'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:108: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:101:in `render_to_string'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:92: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 `block (2 levels) in render'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/benchmark.rb:309: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 `block 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 `block 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/abstract_controller/base.rb:148:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:435:in `_run__270040631__process_action__950352040__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:404:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:93:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block in instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:117:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:40:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:133:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:173:in `block in action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:89:in `block in recognize'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:66:in `optimized_each'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:88:in `recognize'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:492:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:8:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.1) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:177:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:268:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `block in call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:48:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
/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__126324977_77157520__616967263'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:135:in `block 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:76:in `_render_layout'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:62:in `block in _render_template'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block 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:114:in `_render_template'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:108: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:101:in `render_to_string'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:92: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 `block (2 levels) in render'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/benchmark.rb:309: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 `block 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 `block 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/abstract_controller/base.rb:148:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:435:in `_run__270040631__process_action__950352040__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:404:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:93:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block in instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:117:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:40:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:133:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:173:in `block in action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:89:in `block in recognize'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:66:in `optimized_each'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:88:in `recognize'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:492:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:8:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.1) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:177:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:268:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `block in call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:48:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rubys/.rvm/rubies/ruby-1.9.3-r28929/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Parameters:
None
_csrf_token: "I4egdaGRvgeMzR7FA+7/IdzDI4lNWCSVEtfkvCGLpz4=" cart: #<Cart:0x90c4c1c @items=[]> user_id: 1
GATEWAY_INTERFACE: "CGI/1.1" HTTP_ACCEPT: "text/html" HTTP_COOKIE: "_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly" HTTP_HOST: "localhost:3000" HTTP_USER_AGENT: "Ruby" 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.9.3/2010-08-09)" action_controller.instance: #<UsersController:0x91c40a4 @action_has_layout=true, @view_context_class=nil, @_headers={"Content-Type"=>"text/html"}, @_status=200, @_response=#<ActionDispatch::Response:0x91c3f14 @writer=#<Proc:0x91c3e10@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:44 (lambda)>, @block=nil, @length=0, @header={}, @status=200, @body=[], @cookie=[], @sending_file=false, @blank=false, @cache_control={}, @etag=nil, @request=#<ActionDispatch::Request:0x91c3f64 @env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/users", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "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.9.3/2010-08-09)", "HTTP_ACCEPT"=>"text/html", "HTTP_USER_AGENT"=>"Ruby", "HTTP_COOKIE"=>"_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly", "HTTP_HOST"=>"localhost:3000", "rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x90b265c>, "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.secret_token"=>"70af2f4a808fc9dcb674a466e5ac40287cc2e713d3b2a467ecea1a17c8728cb7b794940d6cd7b08d9b2666235e72da3de9439dab4818d3b5f3014032b1ad6092", "action_dispatch.remote_ip"=>127.0.0.1, "rack.session"=>{"_csrf_token"=>"I4egdaGRvgeMzR7FA+7/IdzDI4lNWCSVEtfkvCGLpz4=", "cart"=>#<Cart:0x90c4c1c @items=[]>, "user_id"=>1}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"e887829ba71c0003b81ab90e827c4c30"}, "rack.request.cookie_string"=>"_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly", "rack.request.cookie_hash"=>{"_session_id"=>"e887829ba71c0003b81ab90e827c4c30", "path"=>"/", "HttpOnly"=>nil}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "e887829ba71c0003b81ab90e827c4c30", data: "BAh7CEkiEF9jc3JmX3Rva2VuBjoGRUZJIjFJNGVnZGFHUnZnZU1...", created_at: "2010-08-08 16:22:38", updated_at: "2010-08-08 16:22:39">, "action_dispatch.request.path_parameters"=>{:controller=>"users", :action=>"index"}, "action_controller.instance"=>#<UsersController:0x91c40a4 ...>, "action_dispatch.request.content_type"=>nil, "action_dispatch.request.request_parameters"=>{}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.parameters"=>{"controller"=>"users", "action"=>"index"}, "action_dispatch.request.accepts"=>[text/html], "action_dispatch.request.formats"=>[text/html], "action_dispatch.request.flash_hash"=>{}, "action_dispatch.request.symbolized_path_parameters"=>{:controller=>"users", :action=>"index"}}, @fullpath="/users", @request_method="GET", @filtered_parameters={"controller"=>"users", "action"=>"index"}, @method="GET">, @content_type="text/html">, @_request=#<ActionDispatch::Request:0x91c3f64 @env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/users", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "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.9.3/2010-08-09)", "HTTP_ACCEPT"=>"text/html", "HTTP_USER_AGENT"=>"Ruby", "HTTP_COOKIE"=>"_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly", "HTTP_HOST"=>"localhost:3000", "rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x90b265c>, "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.secret_token"=>"70af2f4a808fc9dcb674a466e5ac40287cc2e713d3b2a467ecea1a17c8728cb7b794940d6cd7b08d9b2666235e72da3de9439dab4818d3b5f3014032b1ad6092", "action_dispatch.remote_ip"=>127.0.0.1, "rack.session"=>{"_csrf_token"=>"I4egdaGRvgeMzR7FA+7/IdzDI4lNWCSVEtfkvCGLpz4=", "cart"=>#<Cart:0x90c4c1c @items=[]>, "user_id"=>1}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"e887829ba71c0003b81ab90e827c4c30"}, "rack.request.cookie_string"=>"_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly", "rack.request.cookie_hash"=>{"_session_id"=>"e887829ba71c0003b81ab90e827c4c30", "path"=>"/", "HttpOnly"=>nil}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "e887829ba71c0003b81ab90e827c4c30", data: "BAh7CEkiEF9jc3JmX3Rva2VuBjoGRUZJIjFJNGVnZGFHUnZnZU1...", created_at: "2010-08-08 16:22:38", updated_at: "2010-08-08 16:22:39">, "action_dispatch.request.path_parameters"=>{:controller=>"users", :action=>"index"}, "action_controller.instance"=>#<UsersController:0x91c40a4 ...>, "action_dispatch.request.content_type"=>nil, "action_dispatch.request.request_parameters"=>{}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.parameters"=>{"controller"=>"users", "action"=>"index"}, "action_dispatch.request.accepts"=>[text/html], "action_dispatch.request.formats"=>[text/html], "action_dispatch.request.flash_hash"=>{}, "action_dispatch.request.symbolized_path_parameters"=>{:controller=>"users", :action=>"index"}}, @fullpath="/users", @request_method="GET", @filtered_parameters={"controller"=>"users", "action"=>"index"}, @method="GET">, @_env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/users", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "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.9.3/2010-08-09)", "HTTP_ACCEPT"=>"text/html", "HTTP_USER_AGENT"=>"Ruby", "HTTP_COOKIE"=>"_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly", "HTTP_HOST"=>"localhost:3000", "rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x90b265c>, "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.secret_token"=>"70af2f4a808fc9dcb674a466e5ac40287cc2e713d3b2a467ecea1a17c8728cb7b794940d6cd7b08d9b2666235e72da3de9439dab4818d3b5f3014032b1ad6092", "action_dispatch.remote_ip"=>127.0.0.1, "rack.session"=>{"_csrf_token"=>"I4egdaGRvgeMzR7FA+7/IdzDI4lNWCSVEtfkvCGLpz4=", "cart"=>#<Cart:0x90c4c1c @items=[]>, "user_id"=>1}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"e887829ba71c0003b81ab90e827c4c30"}, "rack.request.cookie_string"=>"_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly", "rack.request.cookie_hash"=>{"_session_id"=>"e887829ba71c0003b81ab90e827c4c30", "path"=>"/", "HttpOnly"=>nil}, "rack.session.record"=>#<ActiveRecord::SessionStore::Session id: 3, session_id: "e887829ba71c0003b81ab90e827c4c30", data: "BAh7CEkiEF9jc3JmX3Rva2VuBjoGRUZJIjFJNGVnZGFHUnZnZU1...", created_at: "2010-08-08 16:22:38", updated_at: "2010-08-08 16:22:39">, "action_dispatch.request.path_parameters"=>{:controller=>"users", :action=>"index"}, "action_controller.instance"=>#<UsersController:0x91c40a4 ...>, "action_dispatch.request.content_type"=>nil, "action_dispatch.request.request_parameters"=>{}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.parameters"=>{"controller"=>"users", "action"=>"index"}, "action_dispatch.request.accepts"=>[text/html], "action_dispatch.request.formats"=>[text/html], "action_dispatch.request.flash_hash"=>{}, "action_dispatch.request.symbolized_path_parameters"=>{:controller=>"users", :action=>"index"}}, @lookup_context=#<ActionView::LookupContext:0x91fb964 @details_key=#<ActionView::LookupContext::DetailsKey:0x8f17900 @hash=686566689>, @details={:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]}, @skip_default_locale=false, @frozen_formats=true, @view_paths=[/home/rubys/git/awdwr/work-193/depot/app/views]>, @_action_name="index", @_response_body=nil, @config={}, @users=[#<User id: 1, name: "dave", hashed_password: "74acdb474f6af45ab3fb0135129562ec0c7c56dc", salt: "694933800.3463585333265501", created_at: "2010-08-08 16:22:32", updated_at: "2010-08-08 16:22:32">]> action_dispatch.parameter_filter: [:password] action_dispatch.remote_ip: 127.0.0.1 action_dispatch.request.accepts: [text/html] action_dispatch.request.content_type: nil action_dispatch.request.flash_hash: {} action_dispatch.request.formats: [text/html] action_dispatch.request.parameters: {"controller"=>"users", "action"=>"index"} action_dispatch.request.path_parameters: {:controller=>"users", :action=>"index"} action_dispatch.request.query_parameters: {} action_dispatch.request.request_parameters: {} action_dispatch.request.symbolized_path_parameters: {:controller=>"users", :action=>"index"} action_dispatch.secret_token: "70af2f4a808fc9dcb674a466e5ac40287cc2e713d3b2a467ecea1a17c8728cb7b794940d6cd7b08d9b2666235e72da3de9439dab4818d3b5f3014032b1ad6092" rack.errors: #<IO:<STDERR>> rack.input: #<StringIO:0x90b265c> rack.multiprocess: false rack.multithread: false rack.request.cookie_hash: {"_session_id"=>"e887829ba71c0003b81ab90e827c4c30", "path"=>"/", "HttpOnly"=>nil} rack.request.cookie_string: "_session_id=e887829ba71c0003b81ab90e827c4c30; path=/; HttpOnly" rack.request.query_hash: {} rack.request.query_string: "" rack.run_once: false rack.session: {"_csrf_token"=>"I4egdaGRvgeMzR7FA+7/IdzDI4lNWCSVEtfkvCGLpz4=", "cart"=>#<Cart:0x90c4c1c @items=[]>, "user_id"=>1} rack.session.options: {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"e887829ba71c0003b81ab90e827c4c30"} rack.session.record: #<ActiveRecord::SessionStore::Session id: 3, session_id: "e887829ba71c0003b81ab90e827c4c30", data: "BAh7CEkiEF9jc3JmX3Rva2VuBjoGRUZJIjFJNGVnZGFHUnZnZU1...", created_at: "2010-08-08 16:22:38", updated_at: "2010-08-08 16:22:39"> 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
/home/rubys/.rvm/gems/ruby-1.9.3-r28929/gems/bundler-1.0.0.rc.3/lib/bundler.rb:183: Use RbConfig instead of obsolete and deprecated Config.
Loading development environment (Rails 3.0.0.rc)
Switch to inspect mode.
>> Product.new
=> #<Product id: nil, title: nil, description: nil, image_url: nil, created_at: nil, updated_at: nil, price: #<BigDecimal:9299088,'0.0',4(8)>>
>>
12.1 Generating the XML Feed 11.3 Iteration F3: Limiting Access