Method: ActionController::Caching::Fragments#fragment_cache_key

Defined in:
actionpack/lib/action_controller/caching/fragments.rb

#fragment_cache_key(key) ⇒ Object

Given a key (as described in expire_fragment), returns a key suitable for use in reading, writing, or expiring a cached fragment. All keys are prefixed with views/ and uses ActiveSupport::Cache.expand_cache_key for the expansion.



21
22
23
# File 'actionpack/lib/action_controller/caching/fragments.rb', line 21

def fragment_cache_key(key)
  ActiveSupport::Cache.expand_cache_key(key.is_a?(Hash) ? url_for(key).split("://").last : key, :views)
end