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.
A0bae8a464f7bdae361c4a07e4f84cd8?d=identicon&s=25 hnchuong@gmail.com (Guest)
on 2007-03-12 12: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
Dfd6f9989147955682701da8227df8b4?d=identicon&s=25 Michael Wang (Guest)
on 2007-03-12 12:20
(Received via mailing list)
hnchuong@gmail.com 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 Wang
A0bae8a464f7bdae361c4a07e4f84cd8?d=identicon&s=25 hnchuong@gmail.com (Guest)
on 2007-03-13 04: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
97c2f62fa74d71faa06d4a096a708416?d=identicon&s=25 Grant Gelinas-Brown (Guest)
on 2007-03-14 04: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
Dfd6f9989147955682701da8227df8b4?d=identicon&s=25 Michael Wang (Guest)
on 2007-03-14 05: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 Wang
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 Jeremy Kemper (Guest)
on 2007-03-14 05:26
(Received via mailing list)
On 3/12/07, hnchuong@gmail.com <hnchuong@gmail.com> 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.