Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

with_output_buffer returns the temporary buffer instead of the result…

… of the block
  • Loading branch information...
commit c88f2b5e23b0cb6c1a3b3687958f45d518414041 1 parent df44df9
@jeremy jeremy authored
View
1  actionpack/lib/action_view/helpers/capture_helper.rb
@@ -123,6 +123,7 @@ def content_for(name, content = nil, &block)
def with_output_buffer(buf = '')
self.output_buffer, old_buffer = buf, output_buffer
yield
+ output_buffer
ensure
self.output_buffer = old_buffer
end
View
1  actionpack/test/template/tag_helper_test.rb
@@ -45,6 +45,7 @@ def test_content_tag_with_block_and_options
end
def test_content_tag_with_block_and_options_outside_of_action_view
+ self.output_buffer = nil
assert_equal content_tag("a", "Create", :href => "create"),
content_tag("a", "href" => "create") { "Create" }
end

1 comment on commit c88f2b5

@denis

This commit broke #content_for in my apps. yield(:something) return empry string instead of ‘string’ when I call content_for(:something) { ‘string’ }

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