Last Updated: February 25, 2016
·
967
· arashm

Make an offline Rails API like api.rubyonrails.org

You need to have the Rails source code of the version you want the API. Either download the package or clone the git repository then checkout to the version you want:

git clone git://github.com/rails/rails.git
git checkout v3.2.9

Install sdoc gem:

gem install sdoc

change your directory to the rails source code and then run the following command:

sdoc -o doc/rails -T direct rails

It takes quite a while to generate the API from source. Then go to doc/rails and open index.html.
checkout sdoc gem for more information.

PS: you can move doc/rails anywhere. It doesn't need the source code to run.

2 Responses
Add your response

As an alternative, check out http://railsapi.com/.

over 1 year ago ·

@joshtgreenwood It uses the same tool, but it's not up to date.

over 1 year ago ·