aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authoryury <yury.korolev@gmail.com>2010-08-24 18:27:49 +0400
committerJosé Valim <jose.valim@gmail.com>2010-09-01 09:57:04 +0200
commit9a6e3ae76322e0a8108f9bcf0a8440769328b9d7 (patch)
treef8c6738cc9d6a84c03c14b3d98bb72a4b37cb60b /actionpack
parent57693d1362dcde9e0e32689255a22414488e1335 (diff)
downloadrails-9a6e3ae76322e0a8108f9bcf0a8440769328b9d7.tar.gz
rails-9a6e3ae76322e0a8108f9bcf0a8440769328b9d7.tar.bz2
rails-9a6e3ae76322e0a8108f9bcf0a8440769328b9d7.zip
Remove unnecessary code from UrlHelper#link_to.
convert_options_to_data_attributes always returns not nil stringified html_options [#5445 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index 56b38b57f4..853ec70392 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -235,13 +235,8 @@ module ActionView
html_options = convert_options_to_data_attributes(options, html_options)
url = url_for(options)
- if html_options
- html_options = html_options.stringify_keys
- href = html_options['href']
- tag_options = tag_options(html_options)
- else
- tag_options = nil
- end
+ href = html_options['href']
+ tag_options = tag_options(html_options)
href_attr = "href=\"#{html_escape(url)}\"" unless href
"<a #{href_attr}#{tag_options}>#{html_escape(name || url)}</a>".html_safe