Sha256: 96aca0bc12b83c1e10091fa266af80314feae97ede516a963d7e04ef86f628a0
Contents?: true
Size: 857 Bytes
Versions: 2
Compression:
Stored size: 857 Bytes
Contents
# Features: # * all features of `cache_key_for` method # * better debugging (accepts view/partial file path for visible part of cache key) # Example (haml): # ```haml # - cache cache_key_for_view(__FILE__, @service.datacenters, 'datacenters', current_company.cache_key, Time.now.utc.to_date.to_s) do # ``` # Rails will generate cache at: # ``` # app_name:views/en/datacenters/5bd92bd352e7726d02175752913014711f5d412e/companies/1-20150619101645935901000/2015-06- # 26/app/views/services/datacenters.html.haml/4324f99340fd2b2bc7e26b8e9b79d8f5 # ``` module CacheKeyForViewHelper include CacheKeyForHelper def cache_key_for_view(file, scoped_collection, collection_prefix, cache_owner_cache_key = '', suffix = '') "#{cache_key_for(scoped_collection, collection_prefix, cache_owner_cache_key, suffix)}#{file.gsub(Rails.root.to_s, '')}" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cache_key_for-0.1.1 | lib/cache_key_for/cache_key_for_view_helper.rb |
cache_key_for-0.1.0 | lib/cache_key_for/cache_key_for_view_helper.rb |