Navigation

ADS specializes in using Ruby on Rails to build advanced, scalable, database-backed web sites for organizations of all sizes. Find out more at our website.

Atlantic Dominion Solutions

Have you ever wanted to generate documentation for your rails application quick and easy? I have recently come across a helpful rake task to help do just that. First lets add a comment to the User class to view it later in the documentation.
 

#This the User class that saves the customers login info to the site.
 
class User < ActiveRecord::Base
  # associations
  has_and_belongs_to_many :roles

Then go to console and use the rake task

rake doc:app

It generates all the html and the stats

Generating HTML...
 
Files:   448
Classes: 298
Modules: 154
Methods: 1340
Elapsed: 45.815s

Your documentation is generated in the doc/app folder with the comments that you added to the User class.

Rails application documentation

 

Share this post

Other posts you may enjoy

You can leave a response, or trackback from your own site.

Print This Post Print This Post

Leave a Reply