Automatically generates HTML docs similar to http://apiwiki.twitter.com/ from your controller specs.
./script/plugin install git://github.com/golubeff/apidocs.git
- Edit app/views/apidocs.erb
- Mark every spec, you want to be documented by calling it_should_be_documented:
- rake spec:doc:api
- Open doc/apidocs.html in your browser
describe PostsController do
describe "list latest posts" do
it "returns a list of posts" do
get :index, :format => "json", :author_id => @author.id
it_should_be_documented
end
end
end
You can add descriptions to each parameter like this:
it_should_be_documented(
:parameters => {
:author_id => "ID of an author (optional)",
:tag => "Optional tag name",
:format => "json or xml"
}
)
- skype: pavel.golubev
- twitter: golubeff
- mail: [email protected]