aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/url_helper.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-05-30 22:53:14 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-05-31 09:38:24 -0300
commitb6eb22cb6490e4c8d0b19541703b0322968c5a1c (patch)
treed3632c2cb3c2d59ae69e9897f272e1bd3a628d83 /actionpack/lib/action_view/helpers/url_helper.rb
parent6471e09217926048be9ff8d05f21863773838b7d (diff)
downloadrails-b6eb22cb6490e4c8d0b19541703b0322968c5a1c.tar.gz
rails-b6eb22cb6490e4c8d0b19541703b0322968c5a1c.tar.bz2
rails-b6eb22cb6490e4c8d0b19541703b0322968c5a1c.zip
Make link_to arguments explicit
Diffstat (limited to 'actionpack/lib/action_view/helpers/url_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index a0fa7d27e9..4b8106f465 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -233,19 +233,15 @@ module ActionView
#
# link_to("Destroy", "http://www.example.com", :method => :delete, :confirm => "Are you sure?")
# # => <a href='http://www.example.com' rel="nofollow" data-method="delete" data-confirm="Are you sure?">Destroy</a>
- def link_to(*args, &block)
+ def link_to(name = nil, options = nil, html_options = nil, &block)
if block_given?
- options = args.first || {}
- html_options = args.second
+ html_options, options = options, name
link_to(capture(&block), options, html_options)
else
- name = args[0]
- options = args[1] || {}
- html_options = args[2]
-
+ options ||= {}
html_options = convert_options_to_data_attributes(options, html_options)
- url = url_for(options)
+ url = url_for(options)
href = html_options['href']
tag_options = tag_options(html_options)