# TODO in rails

16.2k Views Asked by At

I had read through a rails book and once found we can add # TODO: and some # stuff in codes, so we can you some rake cmd to look back.

My problems is I can't find where are those "# stuff" and "rake cmd" I google and search around, but can't find and don't know what keywords to search.

5

There are 5 best solutions below

0
On BEST ANSWER

You can use # TODO, # FIXME, and # OPTIMIZE and you can easily get all of these with the following rake task: rake notes

In addition to the default annotations, you can always specify and search for your own annotations:

rake notes:custom ANNOTATION=ZOMG
0
On

rake notes:todo

1
On
grep -rn "# TODO" .
0
On

btw, you need to run that command from the root dir of your rails app. Also, you can run:

rake -T

to get a full list of the tasks in your rails' Rakefile

0
On

Print all annotations

$ bin/rails notes
app/models/user.rb:
  * [  110] [TODO] Refactor this 

test/test_helper.rb:
  * [   72] [FIXME] Unable to stub this method in the `sign_in` helper

Print specific annotations (FIXME)

$ bin/rails notes -a FIXME
test/test_helper.rb:
  * [ 72] Unable to stub this method in the `sign_in` helper