mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Update url_helper.rb
add block to link_to_if when condition is true
This commit is contained in:
parent
43be687bf3
commit
58c3a04512
1 changed files with 1 additions and 1 deletions
|
@ -410,7 +410,7 @@ module ActionView
|
||||||
# # => <a href="/accounts/show/3">my_username</a>
|
# # => <a href="/accounts/show/3">my_username</a>
|
||||||
def link_to_if(condition, name, options = {}, html_options = {}, &block)
|
def link_to_if(condition, name, options = {}, html_options = {}, &block)
|
||||||
if condition
|
if condition
|
||||||
link_to(name, options, html_options)
|
link_to(name, options, html_options, &block)
|
||||||
else
|
else
|
||||||
if block_given?
|
if block_given?
|
||||||
block.arity <= 1 ? capture(name, &block) : capture(name, options, html_options, &block)
|
block.arity <= 1 ? capture(name, &block) : capture(name, options, html_options, &block)
|
||||||
|
|
Loading…
Reference in a new issue