Insert comments in an erb file
How does one insert comments in an erb file. The normal http tag to insert comments do not work well when there are embedded ruby statements in the html.
<!-- <b>Hello</b><%= @article.author %> -->
The above statement will not stop the evaluation of article.author. Instead, @article.author will still be evaluated and placed as a comment in the generated html file. Say the author was Balpreet, then we have a html comment:
<!-- <b>Hello</b>Balpreet -->
So, what if we want to just comment stuff out, so that the embedded ruby statements are not evaluated at all. There are basically two ways that I think we can achieve this:
1. Insert block level comments using embedded ruby.
<%
=begin %>
<b>Hello</b><%= @article.author %><%
=end %>
2. Insert conditional
<% if false %>
<b>Hello</b><%= @article.author %>
<% end %>
