Detect Googlebot from user agent and use a different layout that doesn't load javascript

This commit is contained in:
Neil Lalonde
2014-02-14 17:10:08 -05:00
parent 0c493c026e
commit d298e2e065
5 changed files with 83 additions and 1 deletions

View File

@@ -1,6 +1,5 @@
module MobileDetection
def self.mobile_device?(user_agent)
# TODO: this is dumb. user agent matching is a doomed approach. a better solution is coming.
user_agent =~ /Mobile|webOS|Nexus 7/ && !(user_agent =~ /iPad/)
end