Finding Documentation

Problem

You're beginning to develope Rails applications, and you have questions. You need to find the latest documentation for Ruby, Rails, and RubyGems libraries.

Solution

The documentation for the latest stable version of the Rails API is online at . A group of hardcore Rails developers also maintains documentation on the bleeding-edge version of Rails at . The latest Ruby documentation is always available at . Here you can find documentation on the Ruby Core library, the Ruby Standard Library, and the C API. In regards to third-party libraries, a comprehensive set of RubyGems documentation is available at . You can also view documentation on any RubyGems you have installed on your local system by starting the gem server with the following command:

$ gem_server

When the gem server is running, you can view the documentation for your local gem repository at . Additional Rails documentation can be found on the wiki at . There you'll find a vast amount of user contributed content. While there's valuable information on the wiki, be warned that some of it can be out of date or inaccurate.

Of late, there's been a growing trend to consolidate essential documentation into so-called cheatsheets. A quick web search for Ruby, Rails, or Prototype cheatsheets should yield some valuable results. One that stands out is the cheat RubyGemit installs a command-line tool to produce Ruby-centric cheatsheets right from your terminal. For more information, visit or install the library with:

$ sudo gem install cheat --source require.errtheblog.com 

Last but not least, GotApi () might best be described as a documentation aggregator. It's a very useful site for looking up not only Ruby and Rails documentation, but other related docs (like JavaScript and CSS).

Discussion

The API documentation can be a little awkward. The format is best suited for looking up the methods of a class or the options of a specific method, and less helpful as an introduction to the framework. One way to become familiar with the major components of Rails via the API is to read the documentation for each base class (e.g., ActionController::Base, ActiveRecord::Base). As you become more proficient with Ruby and Rails, you'll definitely want to browse the source code itself. This experience can be a little overwhelming if you're new to the language or the framework, but there's truly no substitute if you want to understand how all the magic works behind the scenes. Mauricio Fernandez, a long-time Rubyist, keeps a self-study guide to the Ruby source code on his web site (); it can be a useful starting point if you wish to understand Ruby's internals.

See Also