From f204e515ae2a4b6cd037b4b64ffae3b1e1a01df3 Mon Sep 17 00:00:00 2001 From: Chris Kampmeier Date: Sat, 29 Nov 2008 18:10:54 -0800 Subject: Fix typo and cleanup docs for #expire_fragment [#1398 state:resolved] --- .../lib/action_controller/caching/fragments.rb | 26 ++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/actionpack/lib/action_controller/caching/fragments.rb b/actionpack/lib/action_controller/caching/fragments.rb index 31cbe27452..b4ce7f6a3e 100644 --- a/actionpack/lib/action_controller/caching/fragments.rb +++ b/actionpack/lib/action_controller/caching/fragments.rb @@ -83,15 +83,23 @@ module ActionController #:nodoc: end end - # Name can take one of three forms: - # * String: This would normally take the form of a path like "pages/45/notes" - # * Hash: Is treated as an implicit call to url_for, like { :controller => "pages", :action => "notes", :id => 45 } - # * Regexp: Will destroy all the matched fragments, example: - # %r{pages/\d*/notes} - # Ensure you do not specify start and finish in the regex (^$) because - # the actual filename matched looks like ./cache/filename/path.cache - # Regexp expiration is only supported on caches that can iterate over - # all keys (unlike memcached). + # Removes fragments from the cache. + # + # +key+ can take one of three forms: + # * String - This would normally take the form of a path, like + # "pages/45/notes". + # * Hash - Treated as an implicit call to +url_for+, like + # {:controller => "pages", :action => "notes", :id => 45} + # * Regexp - Will remove any fragment that matches, so + # %r{pages/\d*/notes} might remove all notes. Make sure you + # don't use anchors in the regex (^ or $) because + # the actual filename matched looks like + # ./cache/filename/path.cache. Note: Regexp expiration is + # only supported on caches that can iterate over all keys (unlike + # memcached). + # + # +options+ is passed through to the cache store's delete + # method (or delete_matched, for Regexp keys.) def expire_fragment(key, options = nil) return unless cache_configured? -- cgit v1.2.3