Module: UnobtrusiveFlash::ControllerMixin

Defined in:
lib/unobtrusive_flash/controller_mixin.rb

Class Method Summary collapse

Class Method Details

.sanitize_flash(flash) ⇒ Object



22
23
24
25
26
27
# File 'lib/unobtrusive_flash/controller_mixin.rb', line 22

def sanitize_flash(flash)
  flash.to_a.map do |key, value|
    html_safe_value = value.html_safe? ? value : ERB::Util.html_escape(value)
    [key, html_safe_value]
  end
end