使用 Rails 3.2。我想删除所有文本<b>
和标签,但我设法找到仅去除标签的方法。:
string = "
<p>
<b>Section 1</b>
Everything is good.<br>
<b>Section 2</b>
All is well.
</p>"
string.strip_tags
# => "Section 1 Everthing is good. Section 2 All is well."
我想实现这一点:
"Everthing is good. All is well."
我也应该添加正则表达式匹配吗?