public
Created

  • Download Gist
application_helper.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13
module ApplicationHelper
def flash_messages
flash.inject([]) do |array, (level, message)|
array << content_tag(:div, flash_content(message), class: "alert-message #{level} fade in", data: {alert: 'alert'})
end.join.html_safe
end
 
private
 
def flash_content message
link_to('&times;'.html_safe, '#', class: 'close') + content_tag(:p, message)
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.