rubycommentskeyboard-shortcutstext-editorblock-comments

Block commenting in Ruby


Does Ruby have block comments?

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


Solution

  • 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