Flash[:notice] vs Flash.now[:notice]

While working with my new employer (in 2011) I noticed a minor but recurring issue in our application. We had been storing flash[:notice] messages in most of our actions but were not using that flash message anywhere. This was resulting in the flash message showing up at in-appropriate times. What I was unaware of was a slightly different call which is flash.now[:notice]. This results in the flash only having a lifespan of the through the next request. It will not persist if the user clicks a link and follows through to another action.

I found this quick post mentioning the differences. http://www.gatezero.org/blog/2008/10/7/rails-flashnow.html It also links to the following post giving a much more in depth explanation. http://www.rubysavedmylife.com/2007/12/15/flashnotice-vs-flashnownotice/

The long and short for when do use which call is: (Quoted from Tim Harding) flash[:notice] when redirecting flash.now[:notice] when rendering

If you’re redirecting to a new action you want to flash. if you’re rendering in the current action you want to flash.now.