Sha256: 4f1a4fbfbb2ba667ad3ea4582e10819f4eac76cd0f5cf6b8400f754729985348

Contents?: true

Size: 475 Bytes

Versions: 5

Compression:

Stored size: 475 Bytes

Contents

class DashboardController < ApplicationController
  include Foreman::Controller::AutoCompleteSearch
  before_filter :prefetch_data, :only => :index

  def index
    respond_to do |format|
      format.html
      format.yaml { render :text => @report.to_yaml }
      format.json { render :json => @report }
    end
  end

  private

  def prefetch_data
    dashboard = Dashboard.new(params[:search])
    @hosts    = dashboard.hosts
    @report   = dashboard.report
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/app/controllers/dashboard_controller.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/app/controllers/dashboard_controller.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/app/controllers/dashboard_controller.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/app/controllers/dashboard_controller.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/app/controllers/dashboard_controller.rb