class ActiveStorage::Representations::ProxyController

Parent:
ActiveStorage::BaseController

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

Public Instance Methods

show() Show source
# File activestorage/app/controllers/active_storage/representations/proxy_controller.rb, line 8
def show
  http_cache_forever public: true do
    set_content_headers_from representation.image
    stream representation
  end
end

© 2004–2020 David Heinemeier Hansson
Licensed under the MIT License.