<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Ruby on Rails Notes &#187; ERb</title> <atom:link href="http://railsnotes.com/tag/erb/feed/" rel="self" type="application/rss+xml" /><link>http://railsnotes.com</link> <description>A code-heavy brain dump of stuff I come across working on Ruby on Rails projects including Models, ActiveRecord, Views, Controllers, RESTful rails, deployment, server stuff, etc.</description> <lastBuildDate>Sun, 29 Aug 2010 23:45:16 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Commenting Out ERb code in Rails (*.html.erb)</title><link>http://railsnotes.com/34-commenting-out-erb-code-in-rails-htmlerb/</link> <comments>http://railsnotes.com/34-commenting-out-erb-code-in-rails-htmlerb/#comments</comments> <pubDate>Wed, 01 Oct 2008 07:05:27 +0000</pubDate> <dc:creator>Melvin Ram</dc:creator> <category><![CDATA[views]]></category> <category><![CDATA[ERb]]></category><guid
isPermaLink="false">http://railsnotes.wordpress.com/?p=34</guid> <description><![CDATA[Q. Is there an easy way to comment multiple line of ruby in an html.erb file when you have: ... &#60;% .. %&#62; blah &#60;% .. %&#62; blah &#60;% .. %&#62; blah ... I tried to put &#60;!&#8211; &#8211;&#62; around it but its still interpreted. A. There are a few ways. First, you could add [...]]]></description> <content:encoded><![CDATA[<p></p><p><strong>Q.</strong> Is there an easy way to comment multiple line of ruby in an html.erb file when you have:</p><pre>...
&lt;% .. %&gt; blah &lt;% .. %&gt;
blah
&lt;% .. %&gt; blah
...</pre><p>I tried to put &lt;!&#8211; &#8211;&gt; around it but its still interpreted.</p><p>A. There are a few ways. First, you could add a -# at the beginning of the erb tags like this:</p><pre>&lt;%-# whatever erb code -%&gt;</pre><p>Secondly, you could  do an if false statement as explain here <a
href="http://blog.localkinegrinds.com/2008/05/02/erb-block-comments-in-rhtml-templates-using-ruby-on-rails/">http://blog.localkinegrinds.com/2008/05/02/erb-block-comments-in-rhtml-templates-using-ruby-on-rails</a> like this:</p><pre>&lt;% if false %&gt;&lt;!-- start erb comment --&gt;
...
&lt;% .. %&gt; blah &lt;% .. %&gt;
blah
&lt;% .. %&gt; blah
...
&lt;!-- end erb comment --&gt;&lt;% end %&gt;</pre><p>This will color code that portion as a comment in text editors and will prevent it from getting send to the browsers at all.</p> ]]></content:encoded> <wfw:commentRss>http://railsnotes.com/34-commenting-out-erb-code-in-rails-htmlerb/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 2/16 queries in 0.042 seconds using disk

Served from: railsnotes.com @ 2010-09-09 07:37:19 -->