Skip to content

Commit

Permalink
Only call html_safe on flash message that responds to it (#2015)
Browse files Browse the repository at this point in the history
This one line change is already covered by existing feature specs
  • Loading branch information
januszm authored Jul 19, 2021
1 parent 9d20aad commit f8547f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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 %>

0 comments on commit f8547f4

Please sign in to comment.