Class: ForemanMco::DetailedCommandHistoriesController

Inherits:
ApplicationController
  • Object
show all
Includes:
Foreman::Controller::AutoCompleteSearch, Foreman::Controller::TaxonomyMultiple
Defined in:
app/controllers/foreman_mco/detailed_command_histories_controller.rb

Constant Summary collapse

SEARCHABLE_ACTIONS =
%w[index]

Instance Method Summary collapse

Instance Method Details

#controller_nameObject



19
20
21
# File 'app/controllers/foreman_mco/detailed_command_histories_controller.rb', line 19

def controller_name
  "command_history_detailed_command_histories"
end

#indexObject



8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/foreman_mco/detailed_command_histories_controller.rb', line 8

def index
  begin
    search = HostCommandStatus.where(:command_status_id => params[:command_history_id]).search_for(params[:search],:order => params[:order])
  rescue => e
    error e.to_s
    search = HostCommandStatus.where(:command_status_id => params[:command_history_id])
  end
  @details = search.paginate(:page => params[:page])
  @hosts = Host.my_hosts.select([:id, :name]).where(:name => @details.collect(&:host)).index_by(&:name)
end

#model_of_controllerObject



23
24
25
# File 'app/controllers/foreman_mco/detailed_command_histories_controller.rb', line 23

def model_of_controller
  HostCommandStatus
end