Use capture instead of yield in link_to_unless.

[#5162 state:resolved]
This commit is contained in:
José Valim 2010-07-21 15:23:07 +02:00
parent 9dfe9fa693
commit e13e8dcf44

@ -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