Class: Krikri::QaReportsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Krikri::QaReportsController
- Defined in:
- app/controllers/krikri/qa_reports_controller.rb
Overview
Handles HTTP requests for QA Reports
Instance Method Summary collapse
-
#index ⇒ Object
Renders a list of current reports.
-
#show ⇒ Object
Rendering the report as either a full ‘field` report or a `count` report.
Instance Method Details
#index ⇒ Object
Renders a list of current reports
9 10 11 |
# File 'app/controllers/krikri/qa_reports_controller.rb', line 9 def index @reports = Krikri::QAReport.all end |
#show ⇒ Object
Rendering the report as either a full ‘field` report or a `count` report.
Responds to format of ‘text/csv` with a CSV rendering of the requested report type.
18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/krikri/qa_reports_controller.rb', line 18 def show @report = Krikri::QAReport.find(params[:id]) @type = params[:type] == 'count' ? :count : :field respond_to do |format| format.html format.csv { render text: @report.send("#{@type}_csv".to_sym).to_csv } end end |