Skip to content

Commit

Permalink
Fix link_to with block
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Mar 16, 2010
1 parent 9e1e95f commit b3b6ff4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/url_helper.rb
Expand Up @@ -206,7 +206,7 @@ def link_to(*args, &block)
if block_given? if block_given?
options = args.first || {} options = args.first || {}
html_options = args.second html_options = args.second
safe_concat(link_to(capture(&block), options, html_options)) link_to(capture(&block), options, html_options)
else else
name = args[0] name = args[0]
options = args[1] || {} options = args[1] || {}
Expand Down
5 changes: 1 addition & 4 deletions actionpack/test/template/url_helper_test.rb
Expand Up @@ -238,10 +238,7 @@ def test_link_tag_using_delete_javascript_and_href_and_confirm
end end


def test_link_tag_using_block_in_erb def test_link_tag_using_block_in_erb
__in_erb_template = '' output_buffer = link_to("http://example.com") { concat("Example site") }

link_to("http://example.com") { concat("Example site") }

assert_equal '<a href="http://example.com">Example site</a>', output_buffer assert_equal '<a href="http://example.com">Example site</a>', output_buffer
end end


Expand Down

0 comments on commit b3b6ff4

Please sign in to comment.