diff options
Diffstat (limited to 'actionpack/lib/action_controller/caching')
-rw-r--r-- | actionpack/lib/action_controller/caching/actions.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_controller/caching/fragments.rb | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb index d8a1662acc..cb0c3a1384 100644 --- a/actionpack/lib/action_controller/caching/actions.rb +++ b/actionpack/lib/action_controller/caching/actions.rb @@ -129,8 +129,7 @@ module ActionController #:nodoc: end def content_for_layout(controller) - # TODO: Remove this when new base is merged in - template = controller.respond_to?(:template) ? controller.template : controller._action_view + template = controller.view_context template.layout && template.instance_variable_get('@cached_content_for_layout') end end diff --git a/actionpack/lib/action_controller/caching/fragments.rb b/actionpack/lib/action_controller/caching/fragments.rb index 95cba0e411..4ef600bea0 100644 --- a/actionpack/lib/action_controller/caching/fragments.rb +++ b/actionpack/lib/action_controller/caching/fragments.rb @@ -36,8 +36,8 @@ module ActionController #:nodoc: def fragment_for(buffer, name = {}, options = nil, &block) #:nodoc: if perform_caching - if cache = read_fragment(name, options) - buffer.concat(cache) + if fragment_exist?(name,options) + buffer.concat(read_fragment(name, options)) else pos = buffer.length block.call |