Wes Gamble
2006-Apr-17 23:20 UTC
[Rails] Understanding when flash gets reset (render vs. redirect_to)
All, I have a controller action that will do a different "render (:action)" call depending on whether or not data is valid. When the data is invalid - I set a flash element to hold a message. However, when I post back to this controller action and have valid data, I still have the flash element set, which I don''t want. I believe this is because I did a render from the initial controller call. Do I need to use flash.now in this case because I haven''t really generated a new controller instance? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
Trevor Squires
2006-Apr-17 23:39 UTC
[Rails] Understanding when flash gets reset (render vs. redirect_to)
Hey, flash.now[:wibble] = "visible as flash[:wibble] in *this* request" flash[:wibble] = "visible as flash[:wibble] in the *next* request" HTH, Trevor -- Trevor Squires http://somethinglearned.com On 17-Apr-06, at 4:20 PM, Wes Gamble wrote:> All, > > I have a controller action that will do a different "render (:action)" > call > depending on whether or not data is valid. > > When the data is invalid - I set a flash element to hold a message. > > However, when I post back to this controller action and have valid > data, > I still have the flash element set, which I don''t want. > > I believe this is because I did a render from the initial controller > call. > > Do I need to use flash.now in this case because I haven''t really > generated a new controller instance? > > Thanks, > Wes > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Wes Gamble
2006-Apr-17 23:43 UTC
[Rails] Re: Understanding when flash gets reset (render vs. redirect
Trevor, You the man. WG Trevor Squires wrote:> Hey, > > flash.now[:wibble] = "visible as flash[:wibble] in *this* request" > flash[:wibble] = "visible as flash[:wibble] in the *next* request" > > HTH, > Trevor > -- > Trevor Squires > http://somethinglearned.com-- Posted via http://www.ruby-forum.com/.