Created
February 19, 2013 19:32
-
-
Save adamloving/4989057 to your computer and use it in GitHub Desktop.
Applies Twitter bootstrap styles to rails flash messages. Add this to your application layout with = render 'layouts/flash', :locals => { :flash => flash } To quote http://stackoverflow.com/questions/5798791/what-is-the-difference-when-using-flash-error-alert-and-notice "The semantics of what or when to use :alert/:error/:notice are really up to…
This file contains hidden or 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
- if locals[:flash] | |
- flash = locals[:flash] | |
- if flash[:warn] || flash[:alert] | |
.alert #{flash[:warn]} #{flash[:alert]} | |
- if flash[:notice] || flash[:success] | |
.alert.alert-success #{flash[:notice]} #{flash[:success]} | |
- if flash[:info] | |
.alert.alert-info #{flash[:info]} | |
- if flash[:error] | |
.alert.alert-error #{flash[:error]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment