提交 b3b6ff48 编写于 作者: J Jeremy Kemper

Fix link_to with block

上级 9e1e95f7
......@@ -206,7 +206,7 @@ def link_to(*args, &block)
if block_given?
options = args.first || {}
html_options = args.second
safe_concat(link_to(capture(&block), options, html_options))
link_to(capture(&block), options, html_options)
else
name = args[0]
options = args[1] || {}
......
......@@ -238,10 +238,7 @@ def test_link_tag_using_delete_javascript_and_href_and_confirm
end
def test_link_tag_using_block_in_erb
__in_erb_template = ''
link_to("http://example.com") { concat("Example site") }
output_buffer = link_to("http://example.com") { concat("Example site") }
assert_equal '<a href="http://example.com">Example site</a>', output_buffer
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册