我想允许一些特定的
标签,如(< 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 => %w(br)
链接到API Docs.
原文链接:https://www.f2er.com/ruby/270900.html