aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorAnton Davydov <antondavydov.o@gmail.com>2015-04-01 18:32:55 +0300
committerAnton Davydov <antondavydov.o@gmail.com>2015-04-01 18:32:55 +0300
commitfd9d7312a369093084e972793f42f5f437c528f2 (patch)
treec1aae9285142387ec062121be3cc42ec0252c720 /actionview
parentdd39c96f592c83a3d22758a5cee67022bb8f4428 (diff)
downloadrails-fd9d7312a369093084e972793f42f5f437c528f2.tar.gz
rails-fd9d7312a369093084e972793f42f5f437c528f2.tar.bz2
rails-fd9d7312a369093084e972793f42f5f437c528f2.zip
[skip ci] Add information about #link_to target option
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/helpers/url_helper.rb6
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 ||= {}