hi all, after learning happily/smoothly with this agile betabook (from beta 1 ''till 3 like now) with errors here and there but that was no problem, now i''m stuck in def save_order :(( Both examples give me errors after i clicked on checkout button (or submit) it doesn''t show me every fields fails validation effects however i got NameError in Store#save_order undefined local variable or method `find_cart'' for #<StoreController:0x3c22c08> |app/controllers/store_controller.rb:38:in `save_order''| but if i comment line2 (@cart = find_cart) then i got this error: NoMethodError in Store#save_order undefined method `items'' for nil:NilClass |app/controllers/store_controller.rb:40:in `save_order'' C:/rails/depot/script/server:48| oh and about footnote number 3 on page 104, my def save_order is _not_ after private declaration. so i think my problem''s not here (def save_order is before private). FROM BOOK . PAGE 103 Line 1 def save_order - @cart = find_cart - @order = Order.new(params[:order]) - @order.line_items << @cart.items 5 if @order.save - @cart.empty! - redirect_to_index(''Thank you for your order.'') - else - render(:action => ''checkout'') 10 end - end FROM SOURCE CODE - APPENDICES - PAGE 498 def checkout # Loosing this line : @cart = find_cart @items = @cart.items if @items.empty? redirect_to_index("There''s nothing in your cart!") else @order = Order.new end end million thanks for enlightenment. -- Salam hangat, Arie blog : http://blog.riyari.com Y! : riyari3 email: ariekusumaatmaja_at_riyari_titik_com ariekusumaatmaja_at_gmail_titik_com
On Jul 2, 2005, at 5:15 PM, Arie Kusuma Atmaja wrote:> hi all, > after learning happily/smoothly with this agile betabook (from beta 1 > ''till 3 like now) with errors here and there but that was no problem, > now i''m stuck in def save_order :(( > > Both examples give me errors after i clicked on checkout button (or > submit) it doesn''t show me every fields fails validation effects > however i got > > > NameError in Store#save_order > > undefined local variable or method `find_cart'' for > #<StoreController:0x3c22c08> >Do you have a method called find_cart? It was introduced in beta3 when I tidied that code up a bit Cheers Dave
Arie Kusuma Atmaja
2005-Jul-03 23:02 UTC
Re: Agile BetaBook3 = stuck because p.103 != p.498
Dave Thomas wrote:> Do you have a method called find_cart? > > It was introduced in beta3 when I tidied that code up a bit >i didn''t .. but after i added that find_cart method (from source code page) after private (without removing cart method before it), now after i clicked checkout i got this error (eventhough i do have checkout.rhtml in my views ) ActionView::ActionViewError in Store#save_order No rhtml, rxml, or delegate template found for actioncheckout |app/controllers/store_controller.rb:45:in `save_order'' C:/rails/depot/script/server:48| what''s wrong? hmm.. seems i gotta rebuild my depot from the beginning according to this new betabook3 eh? but that''ll be no problem at all i guess.. this repeatition''s making me know rails very well :) BTW i rebuild it on my Debian platform but i''m still working on it. and FYI if u don''t mind i also uploaded my depot source code (with ActionViewError above) (if u mind, then i''ll remove it due to your copyright). anyone of you could see it (and [i hope] could point me to what errors i''ve made) at http://www.riyari.com/files/depot.zip Thank you very much for your reply mr dave. -- Salam hangat, <%= Arie %> | http://blog.riyari.com | Y!: riyari3 email: ariekusumaatmaja_at_riyari_dot_com ariekusumaatmaja_at_gmail_dot_com # Even if you can''t see something # it doesn''t mean it doesn''t exist # # Gorgon
On Jul 3, 2005, at 6:02 PM, Arie Kusuma Atmaja wrote:> i didn''t .. but after i added that find_cart method (from source code > page) after private (without removing cart method before it), now > after i clicked checkout i got this error (eventhough i do have > checkout.rhtml in my views ) > > > ActionView::ActionViewError in Store#save_order > > No rhtml, rxml, or delegate template found for actioncheckout > > |app/controllers/store_controller.rb:45:in `save_order'' > C:/rails/depot/script/server:48| > > what''s wrong?You''re using an old version of Rails. The book needs 0.13 (which should be released today or tomorrow).> BTW i rebuild it on my Debian platform but i''m still working on it. > and FYI if u don''t mind i also uploaded my depot source code (with > ActionViewError above) (if u mind, then i''ll remove it due to your > copyright). anyone of you could see it (and [i hope] could point me to > what errors i''ve made) at http://www.riyari.com/files/depot.zipTo be honest I''d rather you didn''t post a modified version, simply because I can see it getting very confusing. It''s my sincere belief that the application in the book runs against the latest version of Rails--I run it regularly while building the book :) Once you get the latest Rails, I think you''ll find everything works fine. Cheers Dave
Arie Kusuma Atmaja
2005-Jul-05 15:03 UTC
Re: Agile BetaBook3 = stuck because p.103 != p.498
Dave Thomas wrote:> You''re using an old version of Rails. The book needs 0.13 (which should > be released today or tomorrow). > > It''s my sincere belief that the application in the book runs against the > latest version of Rails--I run it regularly while building the book :) > > Once you get the latest Rails, I think you''ll find everything works fine.i just did gem list --remote and today rails is still 0.12.1 is there a good wiki or an easy howto to install rails 0.13 ? or will there be a good explanation (as easy as how to install rails from p.19 - p.21) of how to install _the newest rails_ on (at least) Win, Linux, and mac os x ? i was searching the archives, googling, but i couldn''t find an easy way to this problem (like installing beta gem maybe then the newest rails or something else). i just want to anticipate when agile book uses rails 1.0 at its final release so that i''ll be ready to follow it. :) TIA -- Salam hangat, <%= Arie %> | http://blog.riyari.com | Y!: riyari3 email: ariekusumaatmaja_at_riyari_dot_com ariekusumaatmaja_at_gmail_dot_com # many people criticize many things in ''net # why do they not criticize their life destination paradigm?
The instructions on http://download.rubyonrails.com/ works for me. On 7/5/05, Arie Kusuma Atmaja <ariekusumaatmaja-f7czpFA4K2nQT0dZR+AlfA@public.gmane.org> wrote:> Dave Thomas wrote: > > You''re using an old version of Rails. The book needs 0.13 (which should > > be released today or tomorrow). > > > > It''s my sincere belief that the application in the book runs against the > > latest version of Rails--I run it regularly while building the book :) > > > > Once you get the latest Rails, I think you''ll find everything works fine. > i just did gem list --remote > and today rails is still 0.12.1 > > is there a good wiki or an easy howto to install rails 0.13 ? or will > there be a good explanation (as easy as how to install rails from p.19 - > p.21) of how to install _the newest rails_ on (at least) Win, Linux, and > mac os x ? i was searching the archives, googling, but i couldn''t find > an easy way to this problem (like installing beta gem maybe then the > newest rails or something else). > > i just want to anticipate when agile book uses rails 1.0 at its final > release so that i''ll be ready to follow it. :) > > TIA > > -- > Salam hangat, > <%= Arie %> | http://blog.riyari.com | Y!: riyari3 > email: ariekusumaatmaja_at_riyari_dot_com > ariekusumaatmaja_at_gmail_dot_com > > # many people criticize many things in ''net > # why do they not criticize their life destination paradigm? > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Jul 5, 2005, at 10:03 AM, Arie Kusuma Atmaja wrote:> Dave Thomas wrote: >> You''re using an old version of Rails. The book needs 0.13 (which >> should be released today or tomorrow). >> It''s my sincere belief that the application in the book runs against >> the latest version of Rails--I run it regularly while building the >> book :) >> Once you get the latest Rails, I think you''ll find everything works >> fine. > i just did gem list --remote > and today rails is still 0.12.1 > > is there a good wiki or an easy howto to install rails 0.13 ? or will > there be a good explanation (as easy as how to install rails from p.19 > - p.21) of how to install _the newest rails_ on (at least) Win, Linux, > and mac os x ? i was searching the archives, googling, but i couldn''t > findI was told that 0.13 will be released on the 5th. Regards Dave