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:03:55 -04:00
parent 975f1e6ec8
commit cd590bf1f4
1 changed files with 1 additions and 1 deletions

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