Module: ActionController::Caching::Fragments

Public Instance Methods


expire_fragment_with_locale (name, options = nil)

     # File lib/locale_rails/action_controller.rb, line 118
118:       def expire_fragment_with_locale(name, options = nil)
119:         return unless perform_caching
120: 
121:         fc_store = (respond_to? :cache_store) ? cache_store : fragment_cache_store
122:         key = name.is_a?(Regexp) ? name : fragment_cache_key_without_locale(name)
123:         if key.is_a?(Regexp)
124:           self.class.benchmark "Expired fragments matching: #{key.source}" do
125:             fc_store.delete_matched(key, options)
126:           end
127:         else
128:           key = key.gsub(/:/, ".")
129:           self.class.benchmark "Expired fragment: #{key}, lang = #{I18n.supported_locales}" do
130:             supported_locales.each do |lang|
131:               fc_store.delete("#{key}_#{lang}", options)
132:             end
133:           end
134:         end
135:       end

fragment_cache_key_with_locale (name)

     # File lib/locale_rails/action_controller.rb, line 108
108:       def fragment_cache_key_with_locale(name) 
109:         ret = fragment_cache_key_without_locale(name)
110:         if ret.is_a? String
111:           ret.gsub(/:/, ".") << "_#{I18n.candidates}"
112:         else
113:           ret
114:         end
115:       end