提交 e13e8dcf 编写于 作者: J José Valim

Use capture instead of yield in link_to_unless.

[#5162 state:resolved]
上级 9dfe9fa6
......@@ -398,7 +398,7 @@ def link_to_unless_current(name, options = {}, html_options = {}, &block)
def link_to_unless(condition, name, options = {}, html_options = {}, &block)
if condition
if block_given?
block.arity <= 1 ? yield(name) : yield(name, options, html_options)
block.arity <= 1 ? capture(name, &block) : capture(name, options, html_options, &block)
else
name
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册