Browse files

use AS::SafeBuffer#clone_empty for flushing the output_buffer

  • Loading branch information...
1 parent baf6903 commit 2d4cdb05a5574031de91fff0e11051b56d9bb63a @amatsuda amatsuda committed with tenderlove Feb 13, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_view/helpers/capture_helper.rb
View
2 actionpack/lib/action_view/helpers/capture_helper.rb
@@ -194,7 +194,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 2d4cdb0

Please sign in to comment.