Allow display of multiple flash messages

This commit is contained in:
2024-03-15 02:29:58 +01:00
parent 69db87f9c6
commit 2c0466b51a
2 changed files with 19 additions and 11 deletions

View File

@@ -90,10 +90,12 @@ module ApplicationHelper
end
def render_flash_messages
flash.map do |entry, message|
tag.div class: "flash #{entry}" do
tag.div(sanitize(message)) + tag.button(sanitize("×"), tabindex: -1,
onclick: "this.parentElement.remove();")
flash.map do |entry, messages|
Array(messages).map do |message|
tag.div class: "flash #{entry}" do
tag.div(sanitize(message)) + tag.button(sanitize("×"), tabindex: -1,
onclick: "this.parentElement.remove();")
end
end
end.join.html_safe
end