-
-
Save radar/5529402 to your computer and use it in GitHub Desktop.
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
<%= display_messages %> | |
# returns {:error=>"Email/senha incorretos."} |
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
def display_messages | |
flash.each do |name, message| | |
if message.is_a?(String) | |
case name | |
when :error | |
text = "#b94a48" | |
when :warning | |
text = "#c09853" | |
when :success | |
text = "#468847" | |
when :info | |
text = "#3a87ad" | |
else | |
text = "white" | |
end | |
concat(<<-HTML | |
<div class="alert alert-error alert-block"> | |
<i class="icon-remove icon-large"></i> | |
#{message} | |
</div> | |
HTML | |
) | |
end | |
end | |
end | |
# returns " <div class=\"alert alert-error alert-block\">\n <i class=\"icon-remove icon-large\"></i>\n Email/senha incorretos.\n </div>\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment