How to comment a block of code in RHTML file

Hi Group.

I am just starting with Ruby on Rails. I have been stuck up (not
exactly stuck up but I need to figure this out). I need to comment a
block of code with HTML and RUBY code. Is there any way of commenting
an entire block of code?

Example:

class="s_view_comments_row">
<%if comment.user.photo_exists?%>

How do I comment these 4 lines so that they are not executed when
the .rhtml is parsed.

Lalit

Hi you can do one of the follow:

or

<%# add your commt here -->

Good luck,

-Conrad

has there shortcut?

what shortcut? your IDE’s one?

On 21/05/07, guo william raym [email protected] wrote:

or


in03ng a.k.a inung a.k.a nursamsi a.k.a nur syamsi
Y! in03ng

On 5/21/07, Lalit [email protected] wrote:

<%if comment.user.photo_exists?%>

How do I comment these 4 lines so that they are not executed when
the .rhtml is parsed.

AFAIK erb has no block commenting syntax. Here’s what I usually do
though:

<% if false -%>

.... <% end -%>


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs