diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-05-01 11:02:48 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-05-01 11:02:56 +0200 |
commit | 14d0e0702651de4d825769bddd574aa5066e86f3 (patch) | |
tree | 934bb07ac5052a6ec4768fb489c1d5f285f00eeb /actionview/lib/action_view | |
parent | d459b001b43d25053e7982e96eb8383538a6e358 (diff) | |
download | rails-14d0e0702651de4d825769bddd574aa5066e86f3.tar.gz rails-14d0e0702651de4d825769bddd574aa5066e86f3.tar.bz2 rails-14d0e0702651de4d825769bddd574aa5066e86f3.zip |
Revert "Merge pull request #19844 from stevenspiel/link_to_if_block_helper_addition"
This reverts commit d459b001b43d25053e7982e96eb8383538a6e358, reversing
changes made to 4d4950fae9e2a6970b5f1793aadc56a0b44e28a3.
:sweat:
The block is not supposed to be passed to `link_to`. It's used for a
customized behavior of the `condtion = false` case. The docs
illustrate that like so:
```
<%=
link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) do
link_to(@current_user.login, { controller: "accounts", action: "show", id: @current_user })
end
%>
```
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/url_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb index de1ef7af45..afb1265ad9 100644 --- a/actionview/lib/action_view/helpers/url_helper.rb +++ b/actionview/lib/action_view/helpers/url_helper.rb @@ -410,7 +410,7 @@ module ActionView # # => <a href="/accounts/show/3">my_username</a> def link_to_if(condition, name, options = {}, html_options = {}, &block) if condition - link_to(name, options, html_options, &block) + link_to(name, options, html_options) else if block_given? block.arity <= 1 ? capture(name, &block) : capture(name, options, html_options, &block) |