From 35d12ef3f15184c45b51bfab9b399fe73a7a3ce3 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Sun, 1 Mar 2015 16:20:27 +0900 Subject: fix ActionView::Template::Error when using Streaming with capture. can't acquire a encoding from StreamingBuffer. fixes #12001 --- actionview/lib/action_view/helpers/capture_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actionview/lib/action_view/helpers/capture_helper.rb') diff --git a/actionview/lib/action_view/helpers/capture_helper.rb b/actionview/lib/action_view/helpers/capture_helper.rb index 5a3223968f..a67ba580f1 100644 --- a/actionview/lib/action_view/helpers/capture_helper.rb +++ b/actionview/lib/action_view/helpers/capture_helper.rb @@ -195,7 +195,9 @@ module ActionView def with_output_buffer(buf = nil) #:nodoc: unless buf buf = ActionView::OutputBuffer.new - buf.force_encoding(output_buffer.encoding) if output_buffer + if output_buffer && output_buffer.respond_to?(:encoding) + buf.force_encoding(output_buffer.encoding) + end end self.output_buffer, old_buffer = buf, output_buffer yield -- cgit v1.2.3