From b6eb22cb6490e4c8d0b19541703b0322968c5a1c Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Wed, 30 May 2012 22:53:14 -0300 Subject: Make link_to arguments explicit --- actionpack/lib/action_view/helpers/url_helper.rb | 12 ++++-------- 1 file 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?") # # => Destroy - 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) -- cgit v1.2.3