Created
July 30, 2012 13:59
-
-
Save bansalakhil/3207071 to your computer and use it in GitHub Desktop.
Custom Flash Types in Edge Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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