vzlhia
Last Updated: February 25, 2016
·
3.036K
· robwilliams

Comment out multiple lines in erb

Sometimes when rewriting an erb template you want the original content easy to hand but not rendered in the view. Wrap it in a condition you know will always return false and it won't be. Simple but effective.

<h1>New lovely heading tag</h3>

<% if false %>
  <h3>Old horrible heading tag with a <%= hard_to_remember_variable %></h3>
<% end %>

http://stackoverflow.com/questions/3127644/block-comments-in-html-erb-templates-in-rails

Say Thanks
Respond

2 Responses
Add your response

6137
5cf467ff5efccde39be3f7864142a664

AMAZING

over 1 year ago ·
6138

@RichGuk I sense sarcasm :)

over 1 year ago ·