Is there a multiline ruby "comment" approach? like java's /*

Hi,

Just wondering if there is a way to easy comment out a block of ruby
code
without putting the “#” characters on each line?

Is there an equivalent to java’s /* */, for example:

/* askdf
asd
fasdf
as
dfasd
fa
*/

Thanks

Hi,

Just wondering if there is a way to easy comment out a block of ruby code
without putting the “#” characters on each line?

Is there an equivalent to java’s /* */, for example:
<…>

=begin
your comment…
… going on…
… and on…
=end

Regards,
Rimantas

http://rimantas.com/

excellent - thanks Rimantas

Am I correct in that the =begin and =end have to be on the beginning of
a newline?

Yes, and as far as I know, that’s the only multi-line comment syntax in
Ruby.

Jason

=begin
=end

They must be the first thing on that line. No whitespace can precede it.

Jason

On Tue, Mar 4, 2008 at 5:00 PM, Tony Bianco

I’m using Rails 2.0 and I tried this and this is the error I got

syntax error, unexpected ‘=’
=begin

======== CODE ============
def who_bought
=begin
respond_to do |format|
format.xml {
@product = Product.find(params[:id])
@orders = @product.orders
}
end
=end
end
======== END CODE ========

thanks! That helps. I couldn’t figure out why I couldn’t get it to work.