How do you comment out html mixed with ruby code?
some text <% ... %> more text <%= ... %>
something else
<% ... %>
In js
The opening tag can be
<% <<-COMMENT %>
the above closing erb tag is just for looks (to match the end),
but don't put anything else there, it may show up on the page
or
<%
<<-COMMENT
%>
Anything here won't run or show up in the browser
this will not be displayed in the browser
even in the developer's tools
<% 1_000_000_000_000.times do |count| %>
for the <%= count %>'th time, this won't run a trillion times,
this is all just a string
all of these %>, <%, <% end %>, end, do,
- 热议问题