提交 9a6e3ae7 编写于 作者: Y yury 提交者: José Valim

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: NJosé Valim <jose.valim@gmail.com>
上级 57693d13
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册