Class: Spree::Events::DataExportsController
- Inherits:
-
BaseController
- Object
- Admin::ResourceController
- BaseController
- Spree::Events::DataExportsController
- Defined in:
- app/controllers/spree/events/data_exports_controller.rb
Instance Method Summary collapse
-
#download ⇒ Object
POST: /data_exports/:id/download.
-
#model_class ⇒ Object
override.
Methods inherited from BaseController
#current_event, #default_url_options, #events, #required_user_event!
Methods included from SpreeCmCommissioner::Events::RoleAuthorization
#authorize?, #authorize_admin, #authorize_role!, #redirect_unauthorized_access, #resource_not_found
Instance Method Details
#download ⇒ Object
POST: /data_exports/:id/download
11 12 13 14 15 16 17 18 |
# File 'app/controllers/spree/events/data_exports_controller.rb', line 11 def download export = SpreeCmCommissioner::Export.find_by(uuid: params[:id]) raise ActiveRecord::RecordNotFound, 'Export file is not attached. Please try to generate again.' unless export.exported_file.attached? redirect_to main_app.rails_blob_url(export.exported_file, expires_in: 3600.seconds) # HOST/events/events-tedxphnompenh-2024/data_exports/9313a0c9-5d1f-4c26-983a-f8b796ec141f/download end |
#model_class ⇒ Object
override
6 7 8 |
# File 'app/controllers/spree/events/data_exports_controller.rb', line 6 def model_class SpreeCmCommissioner::Export end |