Kenny Mr
2007-Jan-03 04:12 UTC
Agile Web Development with Rails - Chapter 8, Task C, Error
I am currently in Chapter 8, Task C, Cart Creations. On pages 110 and 111, it shows modifications needed to be made to the following files: app/controllers/store_controller.rb app/views/store/add_to_cart.rhtml app/models/cart.rb When I make the changes and refresh my browser, I get an error message, "No method error in store#add_to_cart". I have defined the total_price method in my cart.rb file, so I fail to see where the error about there not being a method entitled total_price comes up at. Has anyone else had this trouble? Help is appreciated. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Conrad Taylor
2007-Jan-03 05:54 UTC
Re: Agile Web Development with Rails - Chapter 8, Task C, Error
Hi, could you tell me the following: Windows XP? Mac OS X? Ruby Version? Rails Version? -Conrad On 1/2/07, Kenny Mr <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I am currently in Chapter 8, Task C, Cart Creations. On pages 110 and > 111, it shows modifications needed to be made to the following files: > > app/controllers/store_controller.rb > app/views/store/add_to_cart.rhtml > app/models/cart.rb > > When I make the changes and refresh my browser, I get an error message, > "No method error in store#add_to_cart". I have defined the total_price > method in my cart.rb file, so I fail to see where the error about there > not being a method entitled total_price comes up at. Has anyone else > had this trouble? > > Help is appreciated. > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Conrad Taylor
2007-Jan-03 05:59 UTC
Re: Agile Web Development with Rails - Chapter 8, Task C, Error
Hi Kenny, you can also try comparing your code with the code download for your version of the AWDwR. Good luck, -Conrad On 1/2/07, Conrad Taylor <conradwt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, could you tell me the following: > > Windows XP? Mac OS X? > Ruby Version? > Rails Version? > > -Conrad > > On 1/2/07, Kenny Mr <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > I am currently in Chapter 8, Task C, Cart Creations. On pages 110 and > > 111, it shows modifications needed to be made to the following files: > > > > app/controllers/store_controller.rb > > app/views/store/add_to_cart.rhtml > > app/models/cart.rb > > > > When I make the changes and refresh my browser, I get an error message, > > "No method error in store#add_to_cart". I have defined the total_price > > method in my cart.rb file, so I fail to see where the error about there > > not being a method entitled total_price comes up at. Has anyone else > > had this trouble? > > > > Help is appreciated. > > > > -- > > Posted via http://www.ruby-forum.com/. > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Alan Francis
2007-Jan-03 10:38 UTC
Re: Agile Web Development with Rails - Chapter 8, Task C, Er
Kenny Mr wrote:> I am currently in Chapter 8, Task C, Cart Creations. On pages 110 and > 111, it shows modifications needed to be made to the following files: > > app/controllers/store_controller.rb > app/views/store/add_to_cart.rhtml > app/models/cart.rb > > When I make the changes and refresh my browser, I get an error message, > "No method error in store#add_to_cart". I have defined the total_price > method in my cart.rb file, so I fail to see where the error about there > not being a method entitled total_price comes up at. Has anyone else > had this trouble? > > Help is appreciated.Could you please post the full error message ? Alan -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Kenny Mr
2007-Jan-03 13:56 UTC
Re: Agile Web Development with Rails - Chapter 8, Task C, Er
Conrad Taylor wrote:> Hi Kenny, you can also try comparing your code with the code download > for your version of the AWDwR. > > Good luck, > > -ConradThanks. Tried this. Even tried overwriting the code based on what was in specific "depot" files. Still didn''t work. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Dave Thomas
2007-Jan-03 14:24 UTC
Re: Agile Web Development with Rails - Chapter 8, Task C, Er
On Jan 3, 2007, at 7:56 AM, Kenny Mr wrote:> Thanks. Tried this. Even tried overwriting the code based on what > was in specific "depot" files. Still didn''t work.Did you clear out the session and restart the application? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
lists-MMYp1bZq/KasTnJN9+BGXg@public.gmane.org
2007-Jan-03 18:51 UTC
Re: Agile Web Development with Rails - Chapter 8, Task C, Error
Kenny Mr wrote:> I am currently in Chapter 8, Task C, Cart Creations. On pages 110 and > 111, it shows modifications needed to be made to the following files: > > app/controllers/store_controller.rb > app/views/store/add_to_cart.rhtml > app/models/cart.rb > > When I make the changes and refresh my browser, I get an error message, > "No method error in store#add_to_cart". I have defined the total_price > method in my cart.rb file, so I fail to see where the error about there > not being a method entitled total_price comes up at. Has anyone else > had this trouble? > > Help is appreciated.If you read further down 111 you will see that he shows that error to be expected. He then shows you the importance of paying attention to session data. To clear the error you are to run: rake db:session:clear --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
lists-MMYp1bZq/KasTnJN9+BGXg@public.gmane.org
2007-Jan-03 18:56 UTC
Re: Agile Web Development with Rails - Chapter 8, Task C, Error
l...-MMYp1bZq/KasTnJN9+BGXg@public.gmane.org wrote:> Kenny Mr wrote: > rake db:session:cleartypo, should be sessions not session: rake db:sessions:clear --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Kenny Mr
2007-Jan-04 02:45 UTC
Re: Agile Web Development with Rails - Chapter 8, Task C, Er
Conrad Taylor wrote:> Hi, could you tell me the following: > > Windows XP? Mac OS X? > Ruby Version? > Rails Version? > > -ConradWindows XP - Home Edition Ruby 1.8.5 Rails 1.1.6 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Kenny Mr
2007-Jan-04 02:47 UTC
Re: Agile Web Development with Rails - Chapter 8, Task C, Er
Dave Thomas wrote:> On Jan 3, 2007, at 7:56 AM, Kenny Mr wrote: > >> Thanks. Tried this. Even tried overwriting the code based on what >> was in specific "depot" files. Still didn''t work. > > > Did you clear out the session and restart the application?No. At this point, I was at the end of the chapter. It was Iteration C4, Finishing the Cart. Just updated the files as the book stated, then launched Webrick and refreshed my browser. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Kenny Mr
2007-Jan-04 02:52 UTC
Re: Agile Web Development with Rails - Chapter 8, Task C, Er
Kenny Mr wrote:> Dave Thomas wrote: >> On Jan 3, 2007, at 7:56 AM, Kenny Mr wrote: >> >>> Thanks. Tried this. Even tried overwriting the code based on what >>> was in specific "depot" files. Still didn''t work. >> >> >> Did you clear out the session and restart the application? > > No. At this point, I was at the end of the chapter. It was Iteration > C4, Finishing the Cart. Just updated the files as the book stated, then > launched Webrick and refreshed my browser.def total_price @total_price = 0 @items.each { |item| @total_price += item.price } @total_price end Was able to track this down just a little earlier. I made these changes in cart.rb in app/models. Finally was able to display it correctly. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---