Forum: Ruby on Rails Block comment in rhtml file

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
(Guest)
on 2007-03-12 13:15
(Received via mailing list)
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
Michael W. (Guest)
on 2007-03-12 13:20
(Received via mailing list)
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.
(Guest)
on 2007-03-13 05:22
(Received via mailing list)
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
Grant Gelinas-Brown (Guest)
on 2007-03-14 05:52
(Received via mailing list)
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
Michael W. (Guest)
on 2007-03-14 06:09
(Received via mailing list)
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.
Jeremy K. (Guest)
on 2007-03-14 06:26
(Received via mailing list)
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.

<%#
<p>This <%= does %>n't work?</p>
%>

jeremy
This topic is locked and can not be replied to.