Class: ApiDocViewer::MainController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ApiDocViewer::MainController
- Defined in:
- app/controllers/api_doc_viewer/main_controller.rb
Instance Method Summary collapse
Instance Method Details
#documentation ⇒ Object
8 9 10 11 12 13 |
# File 'app/controllers/api_doc_viewer/main_controller.rb', line 8 def documentation path = File.join(Rails.root, 'doc', 'api', params[:link] || 'index.json') return head :unauthorized if path.include?('..') || !path.ends_with?('.json') return head :not_found unless File.exist?(path) render json: File.read(path) end |
#index ⇒ Object
5 6 |
# File 'app/controllers/api_doc_viewer/main_controller.rb', line 5 def index end |