I can do
sudo gem rdoc activerecord --no-ri
and
sudo gem rdoc actionpack --no-ri
both of which give me good docs.
But
sudo gem rdoc rails --no-ri
gives me pretty much nothing, as the Rails gem itself is really just a holder for the others. How can I generate the equivalent of http://api.rubyonrails.org/?
rdoc is generated when the gem is installed (using gem install --no-rdoc [name] skips the local rdoc generation). You can then use gem server to view your local gem rdoc at http://localhost:8808. YARD is an interesting project by Loren Segal to create a next generation Ruby documentation system.
RDoc produces HTML and command-line documentation for Ruby projects. RDoc includes the rdoc and ri tools for generating and displaying documentation from the command-line.
The Rails API documentation is generated with RDoc. To generate it, make sure you are in the rails root directory, run bundle install and execute: Resulting HTML files can be found in the ./doc/rdoc directory. Please consult the RDoc documentation for help with the markup , and also take into account these additional directives.
To summarize, the Rails team uses :nodoc: to mark publicly visible methods and classes for internal use; changes to the visibility of API should be considered carefully and discussed over a pull request first. When documenting parts of Rails API, it's important to remember all of the pieces that go into the Rails stack.
Follow regular punctuation rules: Communicate to the reader the current way of doing things, both explicitly and implicitly. Use the idioms recommended in edge. Reorder sections to emphasize favored approaches if needed, etc. The documentation should be a model for best practices and canonical, modern Rails usage.
Active Record allows you to present the data from database rows as objects and embellish these data objects with business logic methods. Although most Rails models are backed by a database, models can also be ordinary Ruby classes, or Ruby classes that implement a set of interfaces as provided by the Active Model module.
The easiest I found was to just download them from railsapi.com and unpack the file into /Library/Ruby/Gems/1.8/doc/rails-2.3.3/rdoc/
sudo gem rdoc --all --overwrite
If you installed rails with the rdoc (sudo gem install rails) You can access it via
gem server
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With