更新时间:2023-11-08 13:32:58
等价于
raw
.
来自 Ruby on Rails 指南:
要逐字插入内容,请使用 raw
帮助器,而不是调用html_safe
:
To insert something verbatim use the
raw
helper rather than callinghtml_safe
:
<%= raw @cms.current_template %> <%# inserts @cms.current_template as is %>
或者,等效地,使用 :
or, equivalently, use <%==
:
<%== @cms.current_template %> <%# inserts @cms.current_template as is %>