Sha256: f94297b73f93817334fbe65aafa1a2b92715f503b07cae8fe7326d235d7b5c7b

Contents?: true

Size: 638 Bytes

Versions: 15

Compression:

Stored size: 638 Bytes

Contents

# frozen_string_literal: true

module ActionController
  # When you're using the flash, it's generally used as a conditional on the view.
  # This means the content of the view depends on the flash. Which in turn means
  # that the ETag for a response should be computed with the content of the flash
  # in mind. This does that by including the content of the flash as a component
  # in the ETag that's generated for a response.
  module EtagWithFlash
    extend ActiveSupport::Concern

    include ActionController::ConditionalGet

    included do
      etag { flash if request.respond_to?(:flash) && !flash.empty? }
    end
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
actionpack-7.0.8.6 lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.8.5 lib/action_controller/metal/etag_with_flash.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.8.4/lib/action_controller/metal/etag_with_flash.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/actionpack-7.0.5.1/lib/action_controller/metal/etag_with_flash.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/actionpack-7.0.5.1/lib/action_controller/metal/etag_with_flash.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/actionpack-7.0.5.1/lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.8.4 lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.8.1 lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.8 lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.7.2 lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.7.1 lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.7 lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.6 lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.5.1 lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.5 lib/action_controller/metal/etag_with_flash.rb