raw vs. html_safe vs. h to unescape html

前端 未结 6 1539

Suppose I have the following string

@x = \"Turn me into a link\"

In my view, I want a link to be displayed.

6条回答
  •  猫巷女王i
    2020-11-22 05:59

    In Simple Rails terms:

    h remove html tags into number characters so that rendering won't break your html

    html_safe sets a boolean in string so that the string is considered as html save

    raw It converts to html_safe to string

提交回复
热议问题