small medium large xlarge

Generic-user-small
30 Apr 2009, 16:30
Joe Soap (1 post)

Hi,

Very new RoR user completely bogged down with cart only showing one item. Been looking through google suggestions over and over. think i’m lost in all the changes i’ve made!

I’m running: Rails 2.3.2 ruby 1.8.6 (2007-03-13 patchlevel 0) [powerpc-darwin8.11.0] rubygems 1.3.2 sqlite3

pretty sure the problems began somewhere with the config on 107(pdf). The changes suggested werent in my code and application.rb (p.108) is application_controller.rb with rails 2.3 as far as i can tell.

Has anyone else encountered this problem? I can post source code too if needed. Not sure which pages to show though.

Thanks in advance

Lost in RoR!! kind regards

Generic-user-small
01 May 2009, 01:33
Kedar Mhaswade (21 posts)

There could be several reasons this can go wrong. One possibility is that you are getting a new cart every time and it contains the item that you last added. Can you check how many instances of session are there in the sessions table in your database? Also, StoreController is the first thing I will start looking into. One way to debug is: - install ruby-debug (e.g. on Ubuntu, it would be sudo gem install ruby-debug). - change the controller methods like find_cart, add_to_cart and add a statement like debugger (break points) in it - then re-issue the requests and till it hits the break-points and follow them further (Follow the excellent article at: http://guides.rubyonrails.org/debugging_rails_applications.html)

Hope this helps.

-KEdar

You must be logged in to comment