Class: WashoutBuilder::WashoutBuilderController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- WashoutBuilder::WashoutBuilderController
- Defined in:
- app/controllers/washout_builder/washout_builder_controller.rb
Overview
controller that is used to prit all available services or print the documentation for a specific service
Instance Method Summary collapse
-
#all ⇒ void
Will show all api services if no name parameter is receiverd If a name parameter is present will try to use that and find a controller that was that name by camelcasing the name .
Instance Method Details
#all ⇒ void
This method returns an undefined value.
Will show all api services if no name parameter is receiverd If a name parameter is present will try to use that and find a controller that was that name by camelcasing the name . IF a name is provided will show the documentation page for that controller
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/washout_builder/washout_builder_controller.rb', line 17 def all find_all_routes route = params[:name].present? ? controller_is_a_service?(params[:name]) : nil if route.present? @document = WashoutBuilder::Document::Generator.new(route.defaults[:controller]) render template: 'wash_with_html/doc', layout: false, content_type: 'text/html' else @services = all_services render template: 'wash_with_html/all_services', layout: false, content_type: 'text/html' end end |