【发布时间】:2015-05-12 12:10:09
【问题描述】:
假设我想在 erb 页面中显示如何编写 erb 的提示:
在 helpfile.html.erb 中:
Here's the right way to write a basic erb statement: <%= a = 1 %>
问题在于,当该 erb 文件在 rails 中作为视图处理时,文字 erb <%= 被解释,因此在显示的文件中我只看到了
Here's the right way to write a basic erb statement: 1
我该怎么做?
【问题讨论】:
-
或者stackoverflow.com/q/13261376/525478,具体取决于您的用例
标签: ruby-on-rails ruby erb