No Multiline Comments With Ruby on Rails
Feb 28
I’ve searched all over for this one and if you have any insight I’d love to hear it. It turns out there’s no support for multiline comments with Ruby on Rails. I guess I should say that this isn’t even supported in plain Ruby.
A general method for debugging that I use is to comment out chunks of code. This allows me to focus on a piece of code that might be causing a problem. While the exclusion of multiline comments isn’t a major issue, I’ll definitely need to look into alternate debugging techniques. While I realize a single comment (#) can be placed on every line, in some cases this may not be practical. For more information on Ruby feel free to check out this great reference:

Programming Ruby: The Pragmatic Programmers’ Guide, Second Edition

Any decent Ruby editor should allow you to highlight a section of code and use a shortcut to comment it all out. For example, using Eclipse with the Ruby Development Tools plugin, Ctrl-/ will comment the highlighted section of code. Ctrl-/ on already commented code will undo the commenting.
You can also do use =begin and =end
=begin
multiple lines now
commented out
yay.
=end
These keywords must be at the beginning of a line and are actually for internal documentation but they do the trick
Thanks for the reply. I had actually tried that in the past and didn’t have much success. I realized after reading your comment that I should try actually using =begin and =end without any indentation. This did the trick and thanks for pointing their usage!