好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

rails过滤html

rails过滤html

strip_links (html)

Strips all link tags from  text  leaving just the link text.

Examples
  strip_links('<a href="http://HdhCmsTestrubyonrails.org">Ruby on Rails</a>')
  # => Ruby on Rails

  strip_links('Please e-mail me at <a href="mailto:me@email测试数据">me@email测试数据</a>.')
  # => Please e-mail me at me@email测试数据.

  strip_links('Blog: <a href="http://HdhCmsTestmyblog测试数据/" class="nav" target=\"_blank\">Visit</a>.')
  # => Blog: Visit

strip_tags (html)

Strips all HTML tags from the  html , including comments. This uses the html-scanner tokenizer and so its HTML parsing ability is limited by that of html-scanner.

Examples
  strip_tags("Strip <i>these</i> tags!")
  # => Strip these tags!

  strip_tags("<b>Bold</b> no more!  <a href='more.html'>See more here</a>...")
  # => Bold no more!  See more here...

  strip_tags("<div id='top-bar'>Welcome to my website!</div>")
  # => Welcome to my website!

查看更多关于rails过滤html的详细内容...

  阅读:43次

上一篇: rails设置时区

下一篇:datetime rails