I am presently trying to get the cart section (chapter 8.) working
and after following the instructions as carefully as I can determine
I am nonetheless getting the following errors:
URL=http://localhost:3000/store/add_to_cart/10
NameError in Store#add_to_cart
undefined local variable or method `parms'' for
#<StoreController:0x376ee60>
/app/controllers/store_controller.rb:8:in `add_to_cart''
script/server:49
Show framework trace
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/base.rb:756:in `send''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/base.rb:756:in
`perform_action_without_filters''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/filters.rb:295:in
`perform_action_without_benchmark''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:41:in
`perform_action_without_rescue''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:41:in `measure''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:41:in
`perform_action_without_rescue''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/rescue.rb:80:in `perform_action''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/base.rb:356:in `send''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/base.rb:356:in `process''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rails-
0.13.1/lib/dispatcher.rb:32:in `dispatch''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rails-
0.13.1/lib/webrick_server.rb:105:in `handle_dispatch''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rails-
0.13.1/lib/webrick_server.rb:71:in `service''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in
`service''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:155:in
`start_thread''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:144:in
`start_thread''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rails-
0.13.1/lib/webrick_server.rb:57:in `dispatch''
Request
Parameters: {"id"=>"10"}
Show session dump
---
flash: !ruby/hash:ActionController::Flash::FlashHash {}
Response
Headers: {"cookie"=>[],
"Cache-Control"=>"no-cache"}
-----
AND
------
URL= http://localhost:3000/store/display_cart
NoMethodError in Store#display_cart
Showing /store/display_cart.rhtml where line #3 raised:
WARNING: You have a nil object when you probably didn''t expect it!
Odds are you
want an instance of Array instead.
Look in the callstack to see where you''re working with an object that
could be nil.
Investigate your methods and make sure the object is what you expect!
Extracted source (around line #3):
1: <h1>Display Cart</h1>
2: <p>
3: Your cart contains <%= @items.size %> items.
4: </p>
Show template trace
(erb):3:in `evaluate_locals''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_view/base.rb:272:in `evaluate_locals''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_view/base.rb:283:in `rhtml_render''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_view/base.rb:208:in `send''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_view/base.rb:208:in `render_template''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_view/base.rb:173:in `render_file''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/base.rb:588:in `render_with_no_layout''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/layout.rb:216:in
`render_without_benchmark''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:25:in `render''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:25:in `measure''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:25:in `render''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/base.rb:591:in `render_with_no_layout''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/layout.rb:216:in
`render_without_benchmark''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:25:in `render''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:25:in `measure''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:25:in `render''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/base.rb:604:in `render_with_no_layout''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/layout.rb:216:in
`render_without_benchmark''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:25:in `render''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:25:in `measure''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:25:in `render''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/base.rb:627:in `render_with_no_layout''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/layout.rb:210:in
`render_without_benchmark''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:25:in `render''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:25:in `measure''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:25:in `render''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/base.rb:759:in
`perform_action_without_filters''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/filters.rb:295:in
`perform_action_without_benchmark''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:41:in
`perform_action_without_rescue''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:41:in `measure''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/benchmarking.rb:41:in
`perform_action_without_rescue''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/rescue.rb:80:in `perform_action''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/base.rb:356:in `send''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/actionpack-
1.9.1/lib/action_controller/base.rb:356:in `process''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rails-
0.13.1/lib/dispatcher.rb:32:in `dispatch''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rails-
0.13.1/lib/webrick_server.rb:105:in `handle_dispatch''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rails-
0.13.1/lib/webrick_server.rb:71:in `service''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in
`service''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:155:in
`start_thread''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:144:in
`start_thread''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''
c:/usr/local/bin/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start''
c:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rails-
0.13.1/lib/webrick_server.rb:57:in `dispatch''
script/server:49
I am guessing that after adding the items table to the postgresql
database that there is some regeneation step implied but not
explicitly stated. There is also a cryptic note that the section I
am working in is not needed for rails post 0.13.1.
> We expect to see the stub cart display, but instead we are faced with
> a somewhat brutal page. (Although not in Rails 0.13.1 or later, where
> the steps on this page are no longer necessary.) pp.81-82.
Gems list gives me the following for rails:
rails (0.13.1, 0.13.0, 0.12.1)
Web-application framework with template engine, control-flow
layer, and ORM.
Can anyone point out what I am missing?
Regards,
Jim
--
*** e-mail is NOT a secure channel ***
James B. Byrne mailto:ByrneJB.<token>@Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3CE delivery <token> = hal