开发者

"<br>" being changed to "&lt;br&gt;" 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">&lt;br&gt;

The image HTML works fine. Why is <br> not coming through as allowed HTML?


Change it to this:

raw("<br>")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜