且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

<%== %> 是什么意思?在 rails erb 中做什么?

更新时间:2023-11-08 13:32:58

等价于 raw.

来自 Ruby on Rails 指南:

要逐字插入内容,请使用 raw 帮助器,而不是调用html_safe:

To insert something verbatim use the raw helper rather than calling html_safe:

<%= raw @cms.current_template %> <%# inserts @cms.current_template as is %>

或者,等效地,使用 :

or, equivalently, use <%==:

<%== @cms.current_template %> <%# inserts @cms.current_template as is %>