Block comments in html.erb templates in rails

前端 未结 16 2182
北荒
北荒 2020-12-07 09:10

How do you comment out html mixed with ruby code?

some text <% ... %> more text <%= ... %>
something else
<% ... %>

In js

16条回答
  •  生来不讨喜
    2020-12-07 10:04

    I wouldn't count as a solution, but perhaps enclosing the chunk between an

    <% if false %>
       ...
    <% end %>
    

    or if you feel a little dirty, create a helper that simply outputs nothing.

    I've never needed it, but I'm stumbled there seems to be no out-of-the-box solution for this.

提交回复
热议问题