1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/app/controllers/api/exports_controller.rb
Sylvain 4d2f46ca95 [feature] Async statistics export to XLSX
- fix tests due to removal of event_categories
- rake task for generating statistics
2016-07-27 11:28:54 +02:00

14 lines
411 B
Ruby

class API::ExportsController < API::ApiController
before_action :authenticate_user!
before_action :set_export, only: [:download]
def download
authorize @export
send_file File.join(Rails.root, @export.file), :type => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', :disposition => 'attachment'
end
private
def set_export
@export = Export.find(params[:id])
end
end