Class: Apitest::ApitestController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Apitest::ApitestController
- Defined in:
- app/controllers/apitest/apitest_controller.rb
Instance Method Summary collapse
- #index ⇒ Object
-
#initialize ⇒ ApitestController
constructor
A new instance of ApitestController.
- #show ⇒ Object
Constructor Details
#initialize ⇒ ApitestController
Returns a new instance of ApitestController.
6 7 8 9 |
# File 'app/controllers/apitest/apitest_controller.rb', line 6 def initialize super @apidocs = {} end |
Instance Method Details
#index ⇒ Object
10 11 12 13 14 15 |
# File 'app/controllers/apitest/apitest_controller.rb', line 10 def index respond_to do |format| format.json { render json: @apidocs} format.html end end |
#show ⇒ Object
17 18 19 20 21 22 |
# File 'app/controllers/apitest/apitest_controller.rb', line 17 def show respond_to do |format| format.html format.json { render json: @apidocs[params[:id]]} end end |