Class: OpenapiRuby::UiController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/openapi_ruby/ui_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



7
8
9
10
11
12
13
14
15
# File 'app/controllers/openapi_ruby/ui_controller.rb', line 7

def index
  return head :not_found unless OpenapiRuby.configuration.ui_enabled

  config = OpenapiRuby.configuration
  @schemas = config.schemas
  @ui_config = config.ui_config

  render html: swagger_ui_html.html_safe
end

#oauth2_redirectObject



17
18
19
20
21
22
# File 'app/controllers/openapi_ruby/ui_controller.rb', line 17

def oauth2_redirect
  return head :not_found unless OpenapiRuby.configuration.ui_enabled

  file = File.join(OpenapiRuby::Engine.root, "app", "views", "openapi_ruby", "oauth2_redirect.html")
  render file: file, layout: false, content_type: "text/html"
end