Documentation in your Rails app

by Matt Elhotiby on May 20, 2008

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

 

Bookmark and Share

Other Posts That Might Interest You

  1. Ease Rails deployments with Phusion Passenger
  2. Scrum’d Update for 12-22-2009
  3. Get JRuby onto the Rails on Mac OS X
blog comments powered by Disqus

Previous post:

Next post: