[Nitro] Error Handling and Reloading
Arne Brasseur
arne at arnebrasseur.net
Mon Dec 17 00:17:37 EST 2007
Matthew B Gardner schreef:
> This isn't working for me because, I think, the flash object is getting
> cleared too early...here's the code:
>
> def handle_hfile
> @h = request.assign(HelpFile.new)
> if @h.body.empty?
> flash_error "Something is amiss!"
> flash[:form_data] ||= {}
> %w(keywords).map {|w| flash[:form_data][w] = request[w]}
> redirect_referer # :helpfile
> else
> ...
> end
>
> def helpfile
> puts flash[:form_data] #=> nil
> flash[:form_data] = NullClass.new if flash[:form_data].nil?
> end
>
> When #handle_hfile redirects to #helpfile, flash is nil -- I assumed that
> flash would keep its data until the next request. I don't know if this is an
> error on the part of Nitro or my code -- does anything stand out as
> incorrect?
>
> Thanks for all the help thus far,
> -Mat
This looks good to me, but let me guess... I had the same problem using
Firefox and a url http://localhost:9000, when I changed the URL to
http://127.0.0.1:9000 it worked. This could be the same problem. For
some reason in the first case the cookie isn't sent back from the
browser. I tried Konqueror and there both URL's worked. Could that be it?
(ab)
--
Ein Fuchs muß tun, was ein Fuchs tun muß
arne at arnebrasseur.net
More information about the Nitro-general
mailing list