Rails’ Flash is a great way to pass notifications from a controller to a view while redirecting. I just came accross the Flash.now and couldn’t remember when to use Flash.now.
Simply you use
Flash for redirecting:
flash[:notice] = 'You successfully signed up'
and Flash.now for rendering immediatly
flash.now[:notice] = 'You successfully signed up'
Since Rails 2.3 you can also use the default flash options :alert, :notice and :flash direct inside redirect_to
redirect_to post_url(@post), :alert => "Watch it, mister!" redirect_to post_url(@post), :status=> :found, :notice => "Pay attention to the road"