Class: ScaptimonyArfReportsController

Inherits:
ApplicationController
  • Object
show all
Includes:
Foreman::Controller::AutoCompleteSearch
Defined in:
app/controllers/scaptimony_arf_reports_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroy ⇒ Object



23
24
25
26
27
28
29
# File 'app/controllers/scaptimony_arf_reports_controller.rb', line 23

def destroy
  if @arf_report.destroy
    process_success
  else
    process_error
  end
end

#find_by_id ⇒ Object



31
32
33
# File 'app/controllers/scaptimony_arf_reports_controller.rb', line 31

def find_by_id
  @arf_report = resource_base.find(params[:id])
end

#index ⇒ Object



10
11
12
13
14
# File 'app/controllers/scaptimony_arf_reports_controller.rb', line 10

def index
  @arf_reports = resource_base.includes(:arf_report_breakdown, :asset)
    .search_for(params[:search], :order => params[:order])
    .paginate(:page => params[:page], :per_page => params[:per_page])
end

#model_of_controller ⇒ Object



6
7
8
# File 'app/controllers/scaptimony_arf_reports_controller.rb', line 6

def model_of_controller
  ::Scaptimony::ArfReport
end

#parse ⇒ Object



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

def parse
  self.response_body = @arf_report.to_html
end

#show ⇒ Object



16
17
# File 'app/controllers/scaptimony_arf_reports_controller.rb', line 16

def show
end