lib/unobtrusive_flash/controller_mixin.rb
def sanitize_flash(flash, displayable_flash_keys)
        displayable_flash = flash.select { |key, value| displayable_flash_keys.include?(key.to_sym) }
        displayable_flash.map do |key, value|
          html_safe_value = value.html_safe? ? value : ERB::Util.html_escape(value)
          [key.to_s, html_safe_value]
        end
      end
# Prepares a safe and clean version of the flash hash for the frontend
# flash - value of `flash` controller attribute
# displayable_flash_keys - list of flash keys that will be displayed
Prepares a safe and clean version of the flash hash for the frontend
flash - value of `flash` controller attribute
displayable_flash_keys - list of flash keys that will be displayed
Prepares a safe and clean version of the flash hash for the frontend flash - value of ` flash ` controller attribute displayable_flash_keys - list of flash keys that will be displayed
def sanitize_flash(flash, displayable_flash_keys)
        displayable_flash = flash.select { |key, value| displayable_flash_keys.include?(key.to_sym) }
        displayable_flash.map do |key, value|
          html_safe_value = value.html_safe? ? value : ERB::Util.html_escape(value)
          [key.to_s, html_safe_value]
        end
      end
def sanitize_flash ( flash , displayable_flash_keys ) displayable_flash = flash . select { | key , value | displayable_flash_keys . include? ( key . to_sym ) } displayable_flash . map do | key , value | html_safe_value = value . html_safe? ? value : ERB :: Util . html_escape ( value ) [ key . to_s , html_safe_value ] end end
Prepares a safe and clean version of the flash hash for the frontend
flash - value of `flash` controller attribute
displayable_flash_keys - list of flash keys that will be displayed
Prepares a safe and clean version of the flash hash for the frontend flash - value of ` flash ` controller attribute displayable_flash_keys - list of flash keys that will be displayed
flash
displayable_flash_keys