diff options
author | Dimitri Krassovski <labria@startika.com> | 2009-01-26 10:36:31 +0200 |
---|---|---|
committer | Dimitri Krassovski <labria@startika.com> | 2009-01-26 10:36:31 +0200 |
commit | 37fac27cd9bbd1a0e0a0325a87bbfa70cc7baa47 (patch) | |
tree | 050431350d9eba22f8a24d2dd8fd511ec2262015 /actionpack | |
parent | 6df580a0a8fe9c5df2353e5b435590a9a1cab3de (diff) | |
download | rails-37fac27cd9bbd1a0e0a0325a87bbfa70cc7baa47.tar.gz rails-37fac27cd9bbd1a0e0a0325a87bbfa70cc7baa47.tar.bz2 rails-37fac27cd9bbd1a0e0a0325a87bbfa70cc7baa47.zip |
A small addition to the fragment caching documentation
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/caching/fragments.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/caching/fragments.rb b/actionpack/lib/action_controller/caching/fragments.rb index 95cba0e411..aa30b57760 100644 --- a/actionpack/lib/action_controller/caching/fragments.rb +++ b/actionpack/lib/action_controller/caching/fragments.rb @@ -25,6 +25,13 @@ module ActionController #:nodoc: # The expiration call for this example is: # # expire_fragment(:controller => "topics", :action => "list", :action_suffix => "all_topics") + # + # You can also pass a options hash to the call, which is passed on to the read and write methods of your fragment cache store. For example, + # if you are using the MemCacheStore, then you can pass the :expire_in option to make the fragment expire in a certain amount of time. + # + # <% cache "latest_photos", :expires_in => 5.minutes do %> + # <%= render :partial => "photo", :collection => Photo.latest%> + # <% end%> module Fragments # Given a key (as described in <tt>expire_fragment</tt>), returns a key suitable for use in reading, # writing, or expiring a cached fragment. If the key is a hash, the generated key is the return |