Sha256: 7fb16255de693b07f613fe502a5671b1d7a310eca97f098f51c75e184fbbc4d6
Contents?: true
Size: 620 Bytes
Versions: 79
Compression:
Stored size: 620 Bytes
Contents
# frozen_string_literal: true # Sets the <tt>ActiveStorage::Current.url_options</tt> attribute, which the disk service uses to generate URLs. # Include this concern in custom controllers that call ActiveStorage::Blob#url, # ActiveStorage::Variant#url, or ActiveStorage::Preview#url so the disk service can # generate URLs using the same host, protocol, and port as the current request. module ActiveStorage::SetCurrent extend ActiveSupport::Concern included do before_action do ActiveStorage::Current.url_options = { protocol: request.protocol, host: request.host, port: request.port } end end end
Version data entries
79 entries across 76 versions & 8 rubygems