# Commenting out Code

**URL:** <https://www.ruby-forum.com/t/commenting-out-code/100900>\
**Category:** Rails\
**Created:** [August 1, 2006, 9:42pm UTC](https://www.ruby-forum.com/t/commenting-out-code/100900 "2006-08-01T21:42:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 1, 2006, 9:42pm UTC](https://www.ruby-forum.com/t/commenting-out-code/100900/1 "2006-08-01T21:42:34Z")

</div>

Does any one know how to comment out code in a controller (.rb file)

Thanks,  
Yng

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 1, 2006, 9:43pm UTC](https://www.ruby-forum.com/t/commenting-out-code/100900/2 "2006-08-01T21:43:13Z")

</div>

I actually need to know how to add a comment to the end of a line… any  
insight?

yngwie wrote:

> Does any one know how to comment out code in a controller (.rb file)
> 
> Thanks,  
> Yng

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 1, 2006, 10:00pm UTC](https://www.ruby-forum.com/t/commenting-out-code/100900/3 "2006-08-01T22:00:25Z")

</div>

yngwie wrote:

> I actually need to know how to add a comment to the end of a line… any  
> insight?
> 
> yngwie wrote:
> 
> > Does any one know how to comment out code in a controller (.rb file)

Comments in Ruby start with a # character and run to the end of the  
line.

–  
Philip R.  
[http://tzinfo.rubyforge.org/](http://tzinfo.rubyforge.org/) – DST-aware timezone library for Ruby

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 1, 2006, 10:04pm UTC](https://www.ruby-forum.com/t/commenting-out-code/100900/4 "2006-08-01T22:04:22Z")

</div>

Also, you can comment multiple lines like this:

def action  
=begin  
can’t see me!

=end  
end

but I do believe that the “=” has to be the first character on the line.
