Class: Apitest::ApitestController

Inherits:
ApplicationController show all
Defined in:
app/controllers/apitest/apitest_controller.rb

Instance Method Summary collapse

Constructor Details

#initializeApitestController

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

#indexObject



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

#showObject



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