Skip to content

Commit

Permalink
Use capture instead of yield in link_to_unless.
Browse files Browse the repository at this point in the history
[#5162 state:resolved]
  • Loading branch information
josevalim committed Jul 21, 2010
1 parent 9dfe9fa commit e13e8dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/url_helper.rb
Expand Up @@ -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
Expand Down

0 comments on commit e13e8dc

Please sign in to comment.