Sha256: d393a8d40691945b1f512d9e653d1ca8e1dbe1ee92472048893c1fdac292e58e

Contents?: true

Size: 610 Bytes

Versions: 196

Compression:

Stored size: 610 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 unless flash.empty? }
    end
  end
end

Version data entries

196 entries across 184 versions & 11 rubygems

Version Path
actionpack-6.1.7.10 lib/action_controller/metal/etag_with_flash.rb
actionpack-6.1.7.9 lib/action_controller/metal/etag_with_flash.rb
actionpack-6.1.7.8 lib/action_controller/metal/etag_with_flash.rb
actionpack-6.1.7.7 lib/action_controller/metal/etag_with_flash.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actionpack-7.0.3.1/lib/action_controller/metal/etag_with_flash.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actionpack-7.0.2.3/lib/action_controller/metal/etag_with_flash.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/etag_with_flash.rb
actionpack-6.1.7.6 lib/action_controller/metal/etag_with_flash.rb
actionpack-6.1.7.5 lib/action_controller/metal/etag_with_flash.rb
actionpack-6.1.7.4 lib/action_controller/metal/etag_with_flash.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionpack-7.0.2.3/lib/action_controller/metal/etag_with_flash.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/etag_with_flash.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionpack-7.0.3.1/lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.4.3 lib/action_controller/metal/etag_with_flash.rb
actionpack-6.1.7.3 lib/action_controller/metal/etag_with_flash.rb
actionpack-6.1.7.2 lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.4.2 lib/action_controller/metal/etag_with_flash.rb
actionpack-7.0.4.1 lib/action_controller/metal/etag_with_flash.rb
actionpack-6.1.7.1 lib/action_controller/metal/etag_with_flash.rb
actionpack-6.0.6.1 lib/action_controller/metal/etag_with_flash.rb