Skip to content

Instantly share code, notes, and snippets.

@bansalakhil
Created July 30, 2012 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bansalakhil/3207071 to your computer and use it in GitHub Desktop.
Save bansalakhil/3207071 to your computer and use it in GitHub Desktop.
Custom Flash Types in Edge Rails
# Rails Edge: Custom Flash Types
#
#Rails just got some syntactic sugar for dealing with flash messages in
#your controllers and views.
#
#You can now declare the following in your controllers:
#
class ApplicationController
add_flash_types :error, :warning
end
#And then you'll be able to use
<%= error %>
#in your views and
redirect_to root_path, error: "message"
#in your controllers.
#
#Commit message: [Added support add_flash_types](https://github.com/rails/rails/commit/238a4253bf229377b686bfcecc63dda2b59cff8f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment