Permalink
Browse files

use AS::SafeBuffer#clone_empty for flushing the output_buffer

  • Loading branch information...
amatsuda authored and tenderlove committed Feb 13, 2012
1 parent e50ee96 commit 6adc41789017682306181e3db5b30337fe450bcc
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_view/helpers/capture_helper.rb
@@ -179,7 +179,7 @@ def with_output_buffer(buf = nil) #:nodoc:
def flush_output_buffer #:nodoc:
if output_buffer && !output_buffer.empty?
response.body_parts << output_buffer
- self.output_buffer = output_buffer[0,0]
+ self.output_buffer = output_buffer.respond_to?(:clone_empty) ? output_buffer.clone_empty : output_buffer[0, 0]
nil
end
end

0 comments on commit 6adc417

Please sign in to comment.