// Add this to your application_helper.rb. def display_standard_flashes known_levels = [:error, :warning, :notice] # highest priority to lowest level = known_levels.find { |level| flash.has_key?(level) } level ? content_tag('div', flash[level], :class => "flash #{level}") : nil end
You need to create an account or log in to post comments to this site.