mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
4d2f46ca95
- fix tests due to removal of event_categories - rake task for generating statistics
14 lines
411 B
Ruby
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 |