Skip to content
This repository
Browse code

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 Korolev authored August 24, 2010 josevalim committed September 01, 2010
9  actionpack/lib/action_view/helpers/url_helper.rb
@@ -235,13 +235,8 @@ def link_to(*args, &block)
235 235
           html_options = convert_options_to_data_attributes(options, html_options)
236 236
           url = url_for(options)
237 237
 
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)
245 240
 
246 241
           href_attr = "href=\"#{html_escape(url)}\"" unless href
247 242
           "<a #{href_attr}#{tag_options}>#{html_escape(name || url)}</a>".html_safe

0 notes on commit 9a6e3ae

Please sign in to comment.
Something went wrong with that request. Please try again.