Put

问题描述 投票:1回答:2

假设我要在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

我该怎么做?

ruby-on-rails ruby erb
2个回答
2
投票

您可以将其写为:


1
投票

尝试使用实体:

© www.soinside.com 2019 - 2024. All rights reserved.