Strip html from string Ruby on Rails

后端 未结 6 1787
孤独总比滥情好
孤独总比滥情好 2020-12-07 16:35

I\'m working with Ruby on Rails, Is there a way to strip html from a string using sanitize or equal method and keep only text inside value attribute on input ta

6条回答
  •  时光说笑
    2020-12-07 16:36

    If we want to use this in model

    ActionView::Base.full_sanitizer.sanitize(html_string)
    

    which is the code in "strip_tags" method

提交回复
热议问题