Class: AboutPage::AboutController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/about_page/about_controller.rb

Instance Method Summary collapse

Instance Method Details

#healthObject



24
25
26
27
28
29
30
31
32
# File 'app/controllers/about_page/about_controller.rb', line 24

def health
  @states = @configuration.health_report
  respond_to do |format|
    format.html { render }
    format.json { render :json => @states }
    format.xml  { render :xml  => @states }
    format.yaml { render :text => @states.to_yaml, :content_type => 'text/yaml' }
  end
end

#indexObject



15
16
17
18
19
20
21
22
# File 'app/controllers/about_page/about_controller.rb', line 15

def index
  respond_to do |format|
    format.html { render :status => @configuration.valid? ? 200 : 417 } # about_page.html.erb
    format.json { render :json   => @configuration.to_json }
    format.xml  { render :xml    => @configuration.to_xml  }
    format.yaml { render :text   => @configuration.to_yaml, :content_type => 'text/yaml' }
  end
end

#load_and_filter_configurationObject



8
9
10
11
12
13
# File 'app/controllers/about_page/about_controller.rb', line 8

def load_and_filter_configuration
  @configuration = AboutPage.configuration

  @configuration = @configuration.select { |key, value| (params[:filter].split(/[\W\+]/) + ["app"]).include? key.to_s } if params[:filter]
  @configuration.set_headers!(response)
end