There are a number of options for accessing the API documentation offline.
riYou can use the ri (ruby interactive) command. Generate the rdoc from Rails and install it system-wide (feeding it to @ri@) by doing this:
Switch to your Rails source directory (I installed it with gem and run Gentoo Linux, so my directory location looks like the following).
$ cd /usr/lib/ruby/gems/1.8/gems/
Then parse the code, hunting for rdoc strings, build it all, and install it system-wide. (I have to be a user with administrative priviliges (root) to do this.)
$ rdoc -Y
ALTERNATIVE: Without admin privileges, you can install the rdoc in your homedir with:
$ rdoc —ri
I’ve found rdoc -Y hangs on Rails (1.1.6) it is better to run it in the individual directories you want to build: actionpack, actionmailer, actionwebservices, activerecord, activesupport, and rake. Avoid the rails directory as it appears to be the problem. I believe the rails directory doesn’t have any useful rdoc information. The aforementioned packages should contain everything that composes rails. (Rdoc fails because it is trying to parse an erb template as plain ruby code.)
Note that this is very processor and disk intensive activity, and might cause your computer to feel like it is eating a boomerang made of peyote. I highly recommend that you run it in tandem with the nice command to limit the impact of your processor’s temporary anguish on your computing experience.
gem_serverYou can run the gem server to access the rdoc for any installed gem:
$ gem_server
You can download the official rdoc-generated API documentation Look in the doc directory.
You can generate the rails API documentation as follows:
rails dummycd dummyrake rails:freeze:gemsrake doc:railsThe documentation will be generated in the doc/api directory inside your Rails application. Move this folder to somewhere suitable, and then you can delete the dummy application.
Refer to the page: HowToGenerateChmForRails.
There are CHM readers for both Linux (xchm) and Mac OS X (chmox).
DevBoi is a Firefox sidebar plugin that has help for Rails. Once it is installed, you may need to install the additional Rails API package.
DevBoi update for rails 2.0.2 offline version
Snapshots are no longer available. wget is your friend.