A Ruby Gem wrapper for the ReDoc OpenAPI Specification dynamic documentation project: https://github.com/Rebilly/ReDoc/.
Add this line to your application's Gemfile:
gem 'redoc-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install redoc-rails
Add this line to your application's assets/javascripts/application.js
:
//= require ...
//= require redoc.min
//= require ...
Add the following to a web page:
<redoc></redoc>
Add the following to the appropriate js/coffee file:
# Turbolinks 5
$(document).on 'turbolinks:load', ->
Redoc.init('/swagger.yml', {})
return
# vanilla JS
ready = ->
Redoc.init('/swagger.yml', {})
$(document).ready(ready)
$(document).on('page:load', ready)
If you want detailed information on it usage, you can refer to original documentation.
https://github.com/Rebilly/ReDoc
- v1.22.2: bump, latest stable redoc plus update gems
- v1.21.2: bump
- v1.19.0: bump, stop shipping the unminified version to save space
- v1.3.3 : bump
- v1.3.2 : bump
- v1.3.0 : initial version
- Fork it ( https://github.com/[my-github-username]/redoc-rails/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request