module Olelo::FlashHelper

Public Instance Methods

flash() click to toggle source
# File lib/olelo/helper.rb, line 109
def flash
  @flash ||= FlashHash.new(env['rack.session'])
end
flash_messages() click to toggle source
# File lib/olelo/helper.rb, line 113
def flash_messages
  li = [:error, :warn, :info].map {|level| flash[level].to_a.map {|msg| %{<li class="#{level}">#{escape_html msg}</li>} } }.flatten
  %{<ul class="flash">#{li.join}</ul>}.html_safe if !li.empty?
end