Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I generate RDOC for (all of) Rails?

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/?

like image 739
James A. Rosen Avatar asked Jul 29 '09 18:07

James A. Rosen


People also ask

How do I create a rdoc?

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.

What is rdoc document?

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.

How do I generate the rails API documentation?

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.

What is nodoc in rails?

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.

How do you write a good rails documentation?

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.

What is active record in rails?

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.


3 Answers

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/

like image 114
James A. Rosen Avatar answered Oct 23 '22 21:10

James A. Rosen


sudo gem rdoc --all --overwrite
like image 16
Tim Hoolihan Avatar answered Oct 23 '22 22:10

Tim Hoolihan


If you installed rails with the rdoc (sudo gem install rails) You can access it via

gem server
like image 9
Mike Avatar answered Oct 23 '22 22:10

Mike