Module: GovukAdminTemplate::ViewHelpers

Defined in:
lib/govuk_admin_template/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#display_flash_messageObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/govuk_admin_template/view_helpers.rb', line 3

def display_flash_message
  html = []

  flash.each do |type, message|
    next unless type.to_sym.in?(%i[success info warning danger])

    html << tag.div(message, class: "alert alert-#{type}")
  end

  html.join.html_safe
end