未验证 提交 a8590da4 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #30997 from q-centrix/nofollow-change

Prevent extra string allocations when no 'rel' arg passed
......@@ -589,10 +589,14 @@ def link_to_remote_options?(options)
end
def add_method_to_attributes!(html_options, method)
if method && method.to_s.downcase != "get".freeze && html_options["rel".freeze] !~ /nofollow/
html_options["rel".freeze] = "#{html_options["rel".freeze]} nofollow".lstrip
if method && method.to_s.downcase != "get" && html_options["rel"] !~ /nofollow/
if html_options["rel"].blank?
html_options["rel"] = "nofollow"
else
html_options["rel"] = "#{html_options["rel"]} nofollow"
end
end
html_options["data-method".freeze] = method
html_options["data-method"] = method
end
def token_tag(token = nil, form_options: {})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册