Skip to content

Commit

Permalink
Remove unnecessary code from UrlHelper#link_to.
Browse files Browse the repository at this point in the history
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
yury authored and josevalim committed Sep 1, 2010
1 parent 57693d1 commit 9a6e3ae
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions actionpack/lib/action_view/helpers/url_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9a6e3ae

Please sign in to comment.