You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
456 B
17 lines
456 B
module ApplicationHelper |
|
|
|
# for each record in the rails flash this |
|
# function wraps the message in an appropriate div |
|
# and displays it |
|
def flash_display(clazz = '') |
|
flashes = flash.select{|key, msg| msg.present?}.collect { |key, msg| |
|
content_tag :div, (content_tag :p, msg), :class => "message #{key}" |
|
}.join |
|
if flashes.present? |
|
content_tag :div, flashes.html_safe, :class => clazz |
|
else |
|
nil |
|
end |
|
end |
|
|
|
end
|
|
|