Merge pull request #8675 from E-L-T/allow-links-in-flash-messages
fix(flash messages): allow links in flash messages
This commit is contained in:
commit
2f0a46386f
2 changed files with 8 additions and 2 deletions
6
app/helpers/sanitize_with_link_helper.rb
Normal file
6
app/helpers/sanitize_with_link_helper.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
module SanitizeWithLinkHelper
|
||||
def sanitize_with_link(value)
|
||||
tags = Rails.configuration.action_view.sanitized_allowed_tags + ['a']
|
||||
sanitize(value, tags:)
|
||||
end
|
||||
end
|
|
@ -7,8 +7,8 @@
|
|||
- if value.class == Array
|
||||
.alert{ class: flash_class(key, sticky: sticky, fixed: fixed), role: flash_role(key) }
|
||||
- value.each do |message|
|
||||
= sanitize(message)
|
||||
= sanitize_with_link(message)
|
||||
%br
|
||||
- else
|
||||
.alert{ class: flash_class(key, sticky: sticky, fixed: fixed), role: flash_role(key) }
|
||||
= sanitize(value)
|
||||
= sanitize_with_link(value)
|
||||
|
|
Loading…
Reference in a new issue