123456789_123456789_123456789_123456789_123456789_

Module: ActionController::EtagWithFlash

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Base, ::ActionView::TestCase::TestController, Rails::ApplicationController, ::Rails::HealthController, Rails::InfoController, Rails::MailersController, Rails::PwaController, Rails::WelcomeController
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Defined in: actionpack/lib/action_controller/metal/etag_with_flash.rb

Overview

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.

ConditionalGet - Attributes & Methods

Class Method Summary

::ActiveSupport::Concern - Extended

class_methods

Define class methods from given block.

included

Evaluate given block in context of base class, so that you can write class macros here.

prepended

Evaluate given block in context of base class, so that you can write class macros here.

Instance Method Summary

ConditionalGet - Included

#expires_in

Sets the Cache-Control header, overwriting existing directives.

#expires_now

Sets an HTTP 1.1 Cache-Control header of no-cache.

#fresh_when

Sets the etag, last_modified, or both on the response, and renders a ‘304 Not Modified` response if the request is already fresh.

#http_cache_forever

Cache or yield the block.

#no_store

Sets an HTTP 1.1 Cache-Control header of no-store.

#stale?

Sets the etag and/or last_modified on the response and checks them against the request.

Head - Included

#head

Returns a response that has no content (merely headers).

DSL Calls

included

[ GitHub ]


18
19
20
# File 'actionpack/lib/action_controller/metal/etag_with_flash.rb', line 18

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

Class Attribute Details

.etaggers (rw)

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/conditional_get.rb', line 15

class_attribute :etaggers, default: []

.etaggers?Boolean (rw)

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/conditional_get.rb', line 15

class_attribute :etaggers, default: []

Instance Attribute Details

#etaggers (rw)

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/conditional_get.rb', line 15

class_attribute :etaggers, default: []

#etaggers?Boolean (rw)

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/conditional_get.rb', line 15

class_attribute :etaggers, default: []