Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个简单的fixture.yml文件:
fixture.yml
label: body: "<%= variable %>"
问题是 ERB 代码被解析为加载夹具的一部分,而我实际上希望正文是字面上的“<%= variable %>”(未插值)。
如何转义 ERB 标签?
%在开始标签上加一秒:
%
label: body: "<%%= variable %>"
该<%%序列是有效的 ERB,呈现为文字<%。
<%%
<%