Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only call html_safe on flash message that responds to it #2015

Merged
merged 1 commit into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/views/administrate/application/_flashes.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This partial renders flash messages on every page.
<% if flash.any? %>
<div class="flashes">
<% flash.each do |key, value| -%>
<% next unless value.respond_to?(:html_safe) %>
<div class="flash flash-<%= key %>"><%= value.html_safe %></div>
<% end -%>
</div>
Expand Down
2 changes: 1 addition & 1 deletion spec/example_app/app/views/application/_flashes.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% if flash.any? %>
<div id="flash">
<% flash.each do |key, value| -%>
<div class="flash-<%= key %>"><%= value %></div>
<div class="flash-<%= key %>"><%= value.html_safe %></div>
<% end -%>
</div>
<% end %>