aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/caching
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/caching')
-rw-r--r--actionpack/lib/action_controller/caching/fragments.rb7
-rw-r--r--actionpack/lib/action_controller/caching/sweeping.rb4
2 files changed, 9 insertions, 2 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
diff --git a/actionpack/lib/action_controller/caching/sweeping.rb b/actionpack/lib/action_controller/caching/sweeping.rb
index c7992d7769..c1be264ffb 100644
--- a/actionpack/lib/action_controller/caching/sweeping.rb
+++ b/actionpack/lib/action_controller/caching/sweeping.rb
@@ -87,9 +87,9 @@ module ActionController #:nodoc:
__send__(action_callback_method_name) if respond_to?(action_callback_method_name, true)
end
- def method_missing(method, *arguments)
+ def method_missing(method, *arguments, &block)
return if @controller.nil?
- @controller.__send__(method, *arguments)
+ @controller.__send__(method, *arguments, &block)
end
end
end