Sha256: 70561519dc654cf031d0eb64bbb1c0ad80aee666a7a279d75c978bbb96f5086c
Contents?: true
Size: 771 Bytes
Versions: 13
Compression:
Stored size: 771 Bytes
Contents
require_dependency "think_feel_do_dashboard/application_controller" module ThinkFeelDoDashboard # Provide access to data exports. class ReportsController < ApplicationController rescue_from ActionController::MissingFile, with: :missing_report def index authorize! :read, "Reports" fetch_reports end 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 private def missing_report redirect_to reports_url, alert: "Report not found" end def fetch_reports @reports = reporter.fetch_reports end def reporter ThinkFeelDoEngine::Reports::Reporter end end end
Version data entries
13 entries across 13 versions & 1 rubygems