rake doc:app
Ruby on Rails provides a rake task that can generate documentation for your rails application. The documentation is placed in the doc/app directory.
rake doc:app
This is convenient, but the down side is that if you want to generate the documentation for your private methods you have to add the :doc: directive to your method declaration, as follows:
private def the_private_method #:doc: # Do stuff end
rdoc
You can generate exactly the same documentation as 'rake doc:app' using the rdoc command. Note that we specify where the documentation should be written using the --op option.
rdoc app --op doc/app
If you want to generate documentation for your private methods, add the --all option. Doing this, you do not need to add the :doc: directive to your method declaration.
rdoc app --op doc/app --all