微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!
safe专题提供safe的最新资讯内容,帮你更好的了解safe。
我想允许一些特定的标签,如(< br>),但让rails继续逃避别人. Html_safe似乎没有参数.这样做最顺利的方法是什么? The sanitize helper will html encode all tags and strip all attributes that aren’t specifically allowed. sanitize @article.body, :tags
在@ post.content中,我想要 1.simple_format,所以内容会有不同的行,而不是单行,没有中断 2.html_safe,因此用户可以粘贴一些< embed>像youtubes这样的视频链接 可以使用<%= simple_format @ post.content%>和<%= @ post.content.html_safe%>分别 但是当我们一起使用它们时:<%= simpl