Class: Spree::Api::V3::Store::DigitalsController
- Inherits:
-
Store::BaseController
- Object
- Store::BaseController
- Spree::Api::V3::Store::DigitalsController
- Defined in:
- app/controllers/spree/api/v3/store/digitals_controller.rb
Instance Method Summary collapse
-
#show ⇒ Object
GET /api/v3/store/digitals/:token.
Instance Method Details
#show ⇒ Object
GET /api/v3/store/digitals/:token
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/spree/api/v3/store/digitals_controller.rb', line 10 def show if @resource. send_data @resource.digital..download, filename: @resource.digital..filename.to_s, type: @resource.digital..content_type else render_error( code: ERROR_CODES[:digital_link_expired], message: 'Download link expired or invalid', status: :forbidden ) end end |