Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有一种干净的方法可以在验证之前删除所有属性的所有 html 标记我发现acts_as_sanitized 似乎很完美,但是对于 rails 2 :-s
谢谢
消毒宝石:
https://github.com/rgrove/sanitize
做你需要的。
调用 Sanitize.clean(htmlstring)。您也可以将允许的标签列入白名单。