Class: WashoutBuilder::WashoutBuilderController

Inherits:
ActionController::Base
  • Object
show all
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

Instance Method Details

#allvoid

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

See Also:

  • #all_services
  • Document::Generator#new


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