Skip to content

Commit

Permalink
Fragment caching needs to operate on the pure output, not the
Browse files Browse the repository at this point in the history
safebuffer.
  • Loading branch information
cmeiklejohn committed Jun 8, 2011
1 parent 1300c03 commit 823aa22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion actionpack/lib/action_view/helpers/cache_helper.rb
Expand Up @@ -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
Expand Down

0 comments on commit 823aa22

Please sign in to comment.