Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fragment caching needs to operate on the pure output, not the

safebuffer.
  • Loading branch information...
commit eb85169b9a9e4bff8cdf8dd0d0d8e3d9e156e747 1 parent 2664897
@cmeiklejohn cmeiklejohn authored sikachu committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 actionpack/lib/action_view/helpers/cache_helper.rb
View
4 actionpack/lib/action_view/helpers/cache_helper.rb
@@ -51,7 +51,9 @@ def fragment_for(name = {}, options = nil, &block) #:nodoc:
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.