Module: ActionController::CachingTracker::TrackPages::InstanceMethods

Defined in:
lib/action_controller/caching_tracker.rb

Instance Method Summary collapse

Instance Method Details

#page_cached?(action = action_name) ⇒ Boolean

Helper to determine if the controller action is currently being page cached (ie. passed to the caches_page method). This is based on the controller instance’s action_name but you can optionally pass the string name of the action:

controller.page_cached?("new")

Returns:

  • (Boolean)


39
40
41
# File 'lib/action_controller/caching_tracker.rb', line 39

def page_cached?(action = action_name)
  page_cached_actions.include?(action)
end