blob: 74fe4dfdde02071947b622e801bfdffcecbec359 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
module FlashHelper
def bootstrap_class_for flash_type
case flash_type
when "success"
"alert-success"
when "error"
"alert-danger"
when "alert"
"alert-warning"
when "notice"
"alert-info"
else
flash_type.to_s
end
end
def flash_message_for(flash_type, message)
case flash_type
when :success
"<i class='fa fa-check-circle'></i> #{message}".html_safe
when :error
"<i class='fa fa-minus-circle'></i> #{message}".html_safe
when :alert
"<i class='fa fa-exclamation-circle'></i> #{message}".html_safe
when :notice
"<i class='fa fa-info-circle'></i> #{message}".html_safe
else
message
end
end
end
|