Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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>
  • Loading branch information...
commit 9a6e3ae76322e0a8108f9bcf0a8440769328b9d7 1 parent 57693d1
@yury yury authored josevalim committed
Showing with 2 additions and 7 deletions.
  1. +2 −7 actionpack/lib/action_view/helpers/url_helper.rb
View
9 actionpack/lib/action_view/helpers/url_helper.rb
@@ -235,13 +235,8 @@ def link_to(*args, &block)
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
Please sign in to comment.
Something went wrong with that request. Please try again.