Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

cool "hidden" rails feature

ok, it's not really hidden, but not much talked about:

In any .builder, .rb, .erb, .haml or .slim file you can add comments like

# TODO: your comment here, e.g. add a test
# FIXME: strange bug
# OPTIMIZE: slow algorithm

You can then find all of these notes in one place by running rake notes in the command line, which will return the type of note, the file and the line-number. Pretty sweet!

Source

2 Answers

Philipp Antar - Does rake notes return all comments or just ones formatted a certain way?

I run a quick test and afaik it returns only those prefixed with the keywords TODO or FIXME or OPTIMIZE, which makes sense because by default there are a lot of comments in some rails files.

N.B. I just realized you don't need the colon from my original post.