diff options
author | Abdelkader Boudih <terminale@gmail.com> | 2015-04-01 16:40:49 +0100 |
---|---|---|
committer | Abdelkader Boudih <terminale@gmail.com> | 2015-04-01 16:40:49 +0100 |
commit | f0590c4c7a7b46ef787a871c31694bd6e679aefe (patch) | |
tree | c1aae9285142387ec062121be3cc42ec0252c720 /actionview/lib | |
parent | dd39c96f592c83a3d22758a5cee67022bb8f4428 (diff) | |
parent | fd9d7312a369093084e972793f42f5f437c528f2 (diff) | |
download | rails-f0590c4c7a7b46ef787a871c31694bd6e679aefe.tar.gz rails-f0590c4c7a7b46ef787a871c31694bd6e679aefe.tar.bz2 rails-f0590c4c7a7b46ef787a871c31694bd6e679aefe.zip |
Merge pull request #19609 from davydovanton/docs-add-target-blank-info
[skip ci] Add information about #link_to target option
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/url_helper.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionview/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb index 89b96ac42c..49da5eba5d 100644 --- a/actionview/lib/action_view/helpers/url_helper.rb +++ b/actionview/lib/action_view/helpers/url_helper.rb @@ -172,6 +172,12 @@ module ActionView # # link_to "Visit Other Site", "http://www.rubyonrails.org/", data: { confirm: "Are you sure?" } # # => <a href="http://www.rubyonrails.org/" data-confirm="Are you sure?">Visit Other Site</a> + # + # Also you can set target attribute with <tt>target</tt> options: + # + # link_to "External link", "http://www.rubyonrails.org/", target: "_blank" + # # => <a href="http://www.rubyonrails.org/" target="_blank">External link</a> + # def link_to(name = nil, options = nil, html_options = nil, &block) html_options, options, name = options, name, block if block_given? options ||= {} |