This post originated from an RSS feed registered with Ruby Buzz
by Mike Naberezny.
Original Post: Keep the Flash and Test it, too.
Feed Title: MikeNaberezny.com
Feed URL: http://mikenaberezny.com/category/ruby/feed/
Feed Description: Mike Naberezny blogs about Ruby, Rails, and other dynamic language topics.
The flash in Ruby on Rails is a special hash that is stored in the session. Its contents are available to the next request and cleared out immediately after.
This makes is very useful one-time events, such as an item being added to a shopping cart:
flash[:success] = "#{cart.items.size} ...