Class: ActiveStorage::BlobsController

Inherits:
BaseController show all
Includes:
SetBlob
Defined in:
activestorage/app/controllers/active_storage/blobs_controller.rb

Overview

Take a signed permanent reference for a blob and turn it into an expiring service URL for download. Note: These URLs are publicly accessible. If you need to enforce access protection beyond the security-through-obscurity factor of the signed blob references, you'll need to implement your own authenticated redirection controller.

Constant Summary

Constants inherited from ActionController::Base

ActionController::Base::MODULES, ActionController::Base::PROTECTED_IVARS

Instance Method Summary collapse

Methods included from ActiveSupport::Concern

#append_features, #class_methods, extended, #included, #prepend_features, #prepended

Methods inherited from ActionController::Base

without_modules

Methods inherited from ActionController::Metal

action, binary_params_for?, controller_name, #controller_name, #dispatch, dispatch, inherited, #initialize, make_response!, middleware, #params, #params=, #performed?, #reset_session, #response_body=, #set_request!, #set_response!, #to_a, #url_for, use

Methods included from ActionController::Testing::Functional

#recycle!

Methods inherited from AbstractController::Base

abstract!, action_methods, #action_methods, #action_name, #available_action?, clear_action_methods!, controller_path, #controller_path, #formats, inherited, internal_methods, method_added, #performed?, #process, #response_body, supports_path?

Methods included from ActiveSupport::DescendantsTracker

clear, #descendants, descendants, #direct_descendants, direct_descendants, #inherited, store_inherited

Methods included from ActiveSupport::Configurable

#config

Constructor Details

This class inherits a constructor from ActionController::Metal

Instance Method Details

#showObject


10
11
12
13
# File 'activestorage/app/controllers/active_storage/blobs_controller.rb', line 10

def show
  expires_in ActiveStorage.service_urls_expire_in
  redirect_to @blob.url(disposition: params[:disposition])
end