Class: Glib::ApiDocsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Glib::ApiDocsController
- Defined in:
- app/controllers/glib/api_docs_controller.rb
Instance Method Summary collapse
-
#component ⇒ Object
GET /glib/json_ui_api/:category/:component.
-
#index ⇒ Object
GET /glib/json_ui_api.
- #json_inject_feature_usage_analytics ⇒ Object
- #json_inject_flash_actions ⇒ Object
-
#json_inject_left_menu ⇒ Object
Override injection methods to do nothing.
- #set_path_prefix ⇒ Object
-
#show ⇒ Object
GET /glib/json_ui_api/:category.
Instance Method Details
#component ⇒ Object
GET /glib/json_ui_api/:category/:component
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'app/controllers/glib/api_docs_controller.rb', line 48 def component @category = params[:category] @component_key = params[:component] @doc = load_documentation(@category) unless @doc render plain: "Category '#{@category}' not found", status: :not_found return end @component = @doc['components'][@component_key] unless @component render plain: "Component '#{@component_key}' not found in category '#{@category}'", status: :not_found return end end |
#index ⇒ Object
GET /glib/json_ui_api
30 31 32 |
# File 'app/controllers/glib/api_docs_controller.rb', line 30 def index @categories = load_all_categories end |
#json_inject_feature_usage_analytics ⇒ Object
22 |
# File 'app/controllers/glib/api_docs_controller.rb', line 22 def json_inject_feature_usage_analytics; end |
#json_inject_flash_actions ⇒ Object
23 |
# File 'app/controllers/glib/api_docs_controller.rb', line 23 def json_inject_flash_actions; end |
#json_inject_left_menu ⇒ Object
Override injection methods to do nothing
21 |
# File 'app/controllers/glib/api_docs_controller.rb', line 21 def ; end |
#set_path_prefix ⇒ Object
25 26 27 |
# File 'app/controllers/glib/api_docs_controller.rb', line 25 def set_path_prefix @path_prefix = 'glib/api_docs' end |
#show ⇒ Object
GET /glib/json_ui_api/:category
35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/controllers/glib/api_docs_controller.rb', line 35 def show @category = params[:category] @doc = load_documentation(@category) unless @doc render plain: "Category '#{@category}' not found", status: :not_found return end @components = @doc['components'] || {} end |