You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
265 B
11 lines
265 B
module FlashesHelper
|
|
FLASH_CLASSES = { alert: "danger", notice: "success", warning: "warning"}.freeze
|
|
|
|
def flash_class(key)
|
|
FLASH_CLASSES.fetch key.to_sym, key
|
|
end
|
|
|
|
def user_facing_flashes
|
|
flash.to_hash.slice "alert", "notice", "warning"
|
|
end
|
|
end
|
|
|