Forum: Ruby on Rails problem in "depot" app - cart contents not shown on checkout

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ken Liu (Guest)
on 2006-04-20 04:10
Hi all -

I'm working my way through the "depot" tutorial.  I'm having a problem
with the section where the cart contents are displayed on the order
page.  The cart contents display fine after I add an item to the cart,
but simply does not show up on the order page.

Any help would be appreciated.

I'm running Locomotive 1.0.0c on Tiger with MySQL from Apachefriends
XAMPP.


Here is a snippet of the log file, where I add an item to an empty cart
and then show the order page.  You can see where I noticed something odd
below.  It appears that the cart is not getting loaded in display_cart()
when in the context of the order page:

Processing StoreController#add_to_cart (for 127.0.0.1 at 2006-04-20
02:02:07) [GET]
  Session ID: 90352668088f989d5f939978b52b2a3a
  Parameters: {"action"=>"add_to_cart", "id"=>"4",
"controller"=>"store"}
  Product Load (0.132395)   SELECT * FROM products WHERE (products.id =
'4') LIMIT 1
  LineItem Columns (0.003741)   SHOW FIELDS FROM line_items
  Product Columns (0.231523)   SHOW FIELDS FROM products
Redirected to http://localhost:3000/store/display_cart
Completed in 0.44364 (2 reqs/sec) | DB: 0.36766 (82%) | 302 Found
[http://localhost/store/add_to_cart/4]
  LineItem Columns (0.003636)   SHOW FIELDS FROM line_items
  Product Columns (0.006785)   SHOW FIELDS FROM products


Processing StoreController#display_cart (for 127.0.0.1 at 2006-04-20
02:02:07) [GET]
  Session ID: 90352668088f989d5f939978b52b2a3a
  Parameters: {"action"=>"display_cart", "controller"=>"store"}
Rendering  within layouts/store
Rendering store/display_cart
Completed in 0.07763 (12 reqs/sec) | Rendering: 0.07472 (96%) | DB:
0.01042 (13%) | 200 OK [http://localhost/store/display_cart]
  LineItem Columns (0.005253)   SHOW FIELDS FROM line_items
  Product Columns (0.078291)   SHOW FIELDS FROM products


Processing StoreController#checkout (for 127.0.0.1 at 2006-04-20
02:02:18) [GET]
  Session ID: 90352668088f989d5f939978b52b2a3a
  Parameters: {"action"=>"checkout", "controller"=>"store"}
  Order Columns (0.007546)   SHOW FIELDS FROM orders
Rendering  within layouts/store
Rendering store/checkout
Start rendering component ({:params=>{:context=>:checkout},
:action=>"display_cart"}):


Processing StoreController#display_cart (for 127.0.0.1 at 2006-04-20
02:02:18) [GET]
  Session ID: 90352668088f989d5f939978b52b2a3a
  Parameters: {"action"=>"display_cart", "id"=>nil,
"controller"=>"store", "context"=>:checkout}

^^^^^^^^^ Is "id" supposed to be nil here?  ^^^^^^^^^
Rendering store/display_cart
Completed in 0.01381 (72 reqs/sec) | Rendering: 0.01303 (94%) | DB:
0.00000 (0%) | 200 OK [http://localhost/store/checkout]


End of component rendering
Completed in 0.06420 (15 reqs/sec) | Rendering: 0.04177 (65%) | DB:
0.09109 (141%) | 200 OK [http://localhost/store/checkout]
This topic is locked and can not be replied to.