Use start_with? instead of String slicing to check for external links

[ci skip]
This commit is contained in:
Robert Speicher
2015-04-12 18:04:50 -04:00
parent 975f1e6ec8
commit cd590bf1f4
+1 -1
View File
@@ -240,7 +240,7 @@ module ApplicationHelper
# external links
def link_to(name = nil, options = nil, html_options = {})
if options.kind_of?(String)
if options[0] != '/' && options[0] != '#'
if !options.start_with?('#', '/')
html_options = add_nofollow(options, html_options)
end
end