In Rails 3, you can pass has attributes directly to redirect_to to set the flash. For example:
redirect_to
redirect_to root_path, :notice => \"Something
In Rails 4 you can do this
class ApplicationController < ActionController::Base add_flash_types :error, ...
and then somewhere
redirect_to root_path, error: 'Some error'
http://blog.remarkablelabs.com/2012/12/register-your-own-flash-types-rails-4-countdown-to-2013