Topic: Multi-line comments??

Does anybody know any way to comment out multiple lines of code?  For example in javascript, you would just use:
<a whole bunch of code would be here>

and that would all be comment.

Re: Multi-line comments??

This is a multi-line comment in an .rb file

This one is untested, but may work:
<%# This is a multi-line comment in an .rhtml file
%> - Brewery and Brewpub management powered by RoR

Re: Multi-line comments??

And don't forget =begin and =end have to be at the very beginning of the line, no indents. I forgot this once and spent an hour trying to find why tongue

Re: Multi-line comments??

Thank you both for the information!  I was about to scream putting # in front of every line when I make changes

Re: Multi-line comments??

I've tried few variations (<%#..., <%=begin ...) but none worked. Probably the simplest way to do this is to define an a comment method in the application_helper.rb:

  def comment(&block)

And use it in rhtml templates
<% comment do %>
.. Some HTML
.. Some ruby scriptlets
<% end %>

Re: Multi-line comments??

Heh, that comment block is a cool idea. smile

Railscasts - Free Ruby on Rails Screencasts