Class: ThinkFeelDoDashboard::ReportsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/think_feel_do_dashboard/reports_controller.rb

Overview

Provide access to data exports.

Instance Method Summary collapse

Instance Method Details

#indexObject



8
9
10
11
# File 'app/controllers/think_feel_do_dashboard/reports_controller.rb', line 8

def index
  authorize! :read, "Reports"
  fetch_reports
end

#showObject



13
14
15
16
17
18
# File 'app/controllers/think_feel_do_dashboard/reports_controller.rb', line 13

def show
  authorize! :read, "Reports"
  file_path = reporter.file_path(params[:id]) || {}

  respond_to { |fmt| fmt.csv { send_file file_path, type: "text/csv" } }
end