Skip to content
This repository
Browse code

use AS::SafeBuffer#clone_empty for flushing the output_buffer

  • Loading branch information...
commit dcf0964d64903605c6dc9d2e149ca0e45bd2aea2 1 parent 71b95bd
Akira Matsuda amatsuda authored tenderlove committed

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  actionpack/lib/action_view/helpers/capture_helper.rb
2  actionpack/lib/action_view/helpers/capture_helper.rb
@@ -215,7 +215,7 @@ def with_output_buffer(buf = nil) #:nodoc:
215 215 def flush_output_buffer #:nodoc:
216 216 if output_buffer && !output_buffer.empty?
217 217 response.body_parts << output_buffer
218   - self.output_buffer = output_buffer[0,0]
  218 + self.output_buffer = output_buffer.respond_to?(:clone_empty) ? output_buffer.clone_empty : output_buffer[0, 0]
219 219 nil
220 220 end
221 221 end

0 comments on commit dcf0964

Please sign in to comment.
Something went wrong with that request. Please try again.