Skip to content

Commit

Permalink
with_output_buffer returns the temporary buffer instead of the result…
Browse files Browse the repository at this point in the history
… of the block
  • Loading branch information
jeremy committed Jun 9, 2008
1 parent df44df9 commit c88f2b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions actionpack/lib/action_view/helpers/capture_helper.rb
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions actionpack/test/template/tag_helper_test.rb
Expand Up @@ -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
Expand Down

1 comment on commit c88f2b5

@denis
Copy link

@denis denis commented on c88f2b5 Jun 10, 2008

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.