Block comment in rhtml file


#1

Hi all,

Is there tags for block comment in rhtml, so that I can comment out a
block of code (mainly for testing/debuging)?

html comment can't prevent ERb code from processed

<%# text inside become comment %> only comment out the the tag

It’s quite inconvenient not to have such facility.

Thanks,

  • Chuong

#2

removed_email_address@domain.invalid wrote:

Hi all,

Is there tags for block comment in rhtml, so that I can comment out a
block of code (mainly for testing/debuging)?

html comment can't prevent ERb code from processed

<%# text inside become comment %> only comment out the the tag

It’s quite inconvenient not to have such facility.

You mean like:

<% if false -%>
…everything skipped…
<% end -%>

?


Michael W.


#3

Hi Michael,

It’s something like that, but your suggestion is just a workaround.
There’s no built-in in rhtml to do this? I want the editor to mark it
as comment also.

In Java JSP files, you have <%-- comment --%>

However your way is useful at some level.

Thanks,

  • Chuong

#4

Grant Gelinas-Brown wrote:

I believe

=begin %>

<% your ruby code here %>
<% and some more %>

=end %>

will work. Make sure the ‘=’ sign is the first thing on a line.

Nope, doesn’t work.


Michael W.


#5

I believe

=begin %>

<% your ruby code here %>
<% and some more %>

=end %>

will work. Make sure the ‘=’ sign is the first thing on a line.

Grant


#6

On 3/12/07, removed_email_address@domain.invalid removed_email_address@domain.invalid wrote:

It’s something like that, but your suggestion is just a workaround.
There’s no built-in in rhtml to do this? I want the editor to mark it
as comment also.

In Java JSP files, you have <%-- comment --%>

However your way is useful at some level.

<%#

This <%= does %>n't work?

%>

jeremy