Class: AbrtReportsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- AbrtReportsController
- Includes:
- AbrtReportsHelper, Foreman::Controller::AutoCompleteSearch
- Defined in:
- app/controllers/abrt_reports_controller.rb
Instance Method Summary collapse
- #action_permission ⇒ Object
-
#destroy ⇒ Object
DELETE /abrt_reports/42.
-
#forward ⇒ Object
POST /abrt_reports/42/forward.
-
#index ⇒ Object
GET /abrt_reports.
-
#show ⇒ Object
GET /abrt_reports/42.
Methods included from AbrtReportsHelper
#count_abrt_reports, #format_reason, #render_abrt_graph, #send_to_abrt_server, #simple_format_if_multiline
Instance Method Details
#action_permission ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'app/controllers/abrt_reports_controller.rb', line 8 def case params[:action] when 'forward' :forward else super end end |
#destroy ⇒ Object
DELETE /abrt_reports/42
31 32 33 34 35 36 37 38 |
# File 'app/controllers/abrt_reports_controller.rb', line 31 def destroy if @abrt_report.destroy notice _("Successfully deleted bug report.") else error @abrt_reports.errors..join("<br/>") end redirect_to abrt_reports_url end |
#forward ⇒ Object
POST /abrt_reports/42/forward
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/abrt_reports_controller.rb', line 41 def forward redirect_to abrt_report_url(@abrt_report) begin response = send_to_abrt_server @abrt_report rescue => e error _("Server rejected our report: #{e.}") and return end begin @abrt_report.add_response response rescue => e error _("Cannot process server response: #{e.}") and return end notice _("Report successfully forwarded") end |
#index ⇒ Object
GET /abrt_reports
18 19 20 |
# File 'app/controllers/abrt_reports_controller.rb', line 18 def index @abrt_reports = resource_base.search_for(params[:search], :order => params[:order]).paginate(:page => params[:page], :per_page => params[:per_page]).includes(:host) end |
#show ⇒ Object
GET /abrt_reports/42
23 24 25 26 27 28 |
# File 'app/controllers/abrt_reports_controller.rb', line 23 def show respond_to do |format| format.html format.json { render :json => @abrt_report.json } end end |