How do I escape the ERB tag in ERB

前端 未结 1 1823
余生分开走
余生分开走 2020-12-02 10:48

I have a simple fixture.yml file:

label:
    body: \"<%= variable %>\"

The issue is that the ERB code is parsed as part

1条回答
  •  时光取名叫无心
    2020-12-02 11:48

    Add a second % to the opening tag:

    label:
        body: "<%%= variable %>"
    

    The <%% sequence is valid ERB, rendered as a literal <%.

    0 讨论(0)
提交回复
热议问题