Class: ActiveStorage::Representations::ProxyController

Inherits:
BaseController
  • Object
show all
Includes:
SetHeaders
Defined in:
app/controllers/active_storage/representations/proxy_controller.rb

Overview

Proxy files through application. This avoids having a redirect and makes files easier to cache.

Instance Method Summary collapse

Instance Method Details

#showObject



7
8
9
10
11
12
# File 'app/controllers/active_storage/representations/proxy_controller.rb', line 7

def show
  http_cache_forever public: true do
    set_content_headers_from @representation.image
    stream @representation
  end
end