diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-06-07 20:25:11 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-06-07 20:25:11 -0700 |
commit | 80edbad786735aaa90f49a543d799c4ad22f5877 (patch) | |
tree | 5bf8d4df65ccdd703007307312e089348619ea9f | |
parent | 1300c034775a5d52ad9141fdf5bbdbb9159df96a (diff) | |
parent | 823aa223efbac6ad4d31ea33402892267bb77cb4 (diff) | |
download | rails-80edbad786735aaa90f49a543d799c4ad22f5877.tar.gz rails-80edbad786735aaa90f49a543d799c4ad22f5877.tar.bz2 rails-80edbad786735aaa90f49a543d799c4ad22f5877.zip |
Merge pull request #1539 from cmeiklejohn/fix_safe_buffer_in_fragment_caching
Fragment caching needs to operate on the pure output, not the safebuffer.
-rw-r--r-- | actionpack/lib/action_view/helpers/cache_helper.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/cache_helper.rb b/actionpack/lib/action_view/helpers/cache_helper.rb index e81d03b537..d070f14af1 100644 --- a/actionpack/lib/action_view/helpers/cache_helper.rb +++ b/actionpack/lib/action_view/helpers/cache_helper.rb @@ -51,7 +51,9 @@ module ActionView # This dance is needed because Builder can't use capture pos = output_buffer.length yield - fragment = output_buffer.slice!(pos..-1) + safe_output_buffer = output_buffer.to_str + fragment = safe_output_buffer.slice!(pos..-1) + self.output_buffer = ActionView::OutputBuffer.new(safe_output_buffer) controller.write_fragment(name, fragment, options) end end |