aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorNico <ncrdevmail@gmail.com>2012-05-02 22:31:24 +0200
committerNico <ncrdevmail@gmail.com>2012-05-02 22:31:24 +0200
commit9a41edf0d9bdd757963aed9885cd4bfce324d613 (patch)
tree40bd44494e6f7872cd0295cb6fdb0c0cfc7b982c /actionpack/lib
parent6a4541d63e65b1de99bc20c9d260ac13c02fa581 (diff)
downloadrails-9a41edf0d9bdd757963aed9885cd4bfce324d613.tar.gz
rails-9a41edf0d9bdd757963aed9885cd4bfce324d613.tar.bz2
rails-9a41edf0d9bdd757963aed9885cd4bfce324d613.zip
added proc evaluation for action cache's layout parameter
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/caching/actions.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb
index 59ec197347..80901b8bf3 100644
--- a/actionpack/lib/action_controller/caching/actions.rb
+++ b/actionpack/lib/action_controller/caching/actions.rb
@@ -133,6 +133,8 @@ module ActionController #:nodoc:
end
def filter(controller)
+ cache_layout = @cache_layout.respond_to?(:call) ? @cache_layout.call(controller) : @cache_layout
+
path_options = if @cache_path.respond_to?(:call)
controller.instance_exec(controller, &@cache_path)
else
@@ -144,13 +146,13 @@ module ActionController #:nodoc:
body = controller.read_fragment(cache_path.path, @store_options)
unless body
- controller.action_has_layout = false unless @cache_layout
+ controller.action_has_layout = false unless cache_layout
yield
controller.action_has_layout = true
body = controller._save_fragment(cache_path.path, @store_options)
end
- body = controller.render_to_string(:text => body, :layout => true) unless @cache_layout
+ body = controller.render_to_string(:text => body, :layout => true) unless cache_layout
controller.response_body = body
controller.content_type = Mime[cache_path.extension || :html]