Block commenting in Ruby

alamodey picture alamodey · Feb 11, 2009 · Viewed 64.6k times · Source

Does Ruby have block comments?

If not, is there an efficient way of inserting # in front of a block of highlighted code in TextMate?

Answer

Garry Shutler picture Garry Shutler · Feb 11, 2009

You can do

=begin
  [Multi line comment]
=end

=begin and =end must be at the beginning of the line (not indented at all).

Source

Also, in TextMate you can press Command + / to toggle regular comments on a highlighted block of code.

Source