Skip to content

Commit 9a6e3ae

Browse files
yuryjosevalim
authored andcommitted
Remove unnecessary code from UrlHelper#link_to.
convert_options_to_data_attributes always returns not nil stringified html_options [rails#5445 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
1 parent 57693d1 commit 9a6e3ae

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

actionpack/lib/action_view/helpers/url_helper.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,8 @@ def link_to(*args, &block)
235235
html_options = convert_options_to_data_attributes(options, html_options)
236236
url = url_for(options)
237237

238-
if html_options
239-
html_options = html_options.stringify_keys
240-
href = html_options['href']
241-
tag_options = tag_options(html_options)
242-
else
243-
tag_options = nil
244-
end
238+
href = html_options['href']
239+
tag_options = tag_options(html_options)
245240

246241
href_attr = "href=\"#{html_escape(url)}\"" unless href
247242
"<a #{href_attr}#{tag_options}>#{html_escape(name || url)}</a>".html_safe

0 commit comments

Comments
 (0)