"<br>" being changed to "<br>" even though I'm using html_safe?
I am calling a helper method from a view to display some media.
index.html.erb
<%= media_display(:media => m[:media], :thumbnail => true).html_safe %>
application_helper.rb
def media_display p = {}
(image_tag p[:开发者_高级运维media].author_picture) + "<br>"
end
HTML output
<img src="path_to_image" alt="Bartolo_normal"><br>
The image HTML works fine. Why is <br>
not coming through as allowed HTML?
Change it to this:
raw("<br>")
精彩评论