Commenting out chunks of view
It’s not as easy to comment out big chunks of Rails erb (view) code. Here’s the one that seems to work fine for people:
<% if false %><!-- comment start --> ... <% ... some code ... %> some html <% ... more code ... %> <!-- comment end --><% end %>
If you simply try using HTML comments, the code will still execute.
Finally, if you want to simply comment out a single ERB statement, put # just after <%, like this:
<%# some ror code here %> <%#= or some talking ror code here %>
- Programming Language:
- Tags:
- Technology:



Recent comments
1 year 23 weeks ago
1 year 23 weeks ago
1 year 25 weeks ago
1 year 27 weeks ago
1 year 42 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 46 weeks ago
1 year 48 weeks ago