1

I am using successfully the mobylette rails gem: https://github.com/tscolari/mobylette

I was wondering if anybody knows of how to disable the gem for iPads...

Thanks a bunch!

Alex

akmur
  • 1,465
  • 2
  • 24
  • 37

2 Answers2

3

Looks like the mobylette gem uses the code from mobile-fu (appears inactive, has issue #21 which is your problem).

The regex matches the iPad user agent on "mobile"

My suggestion -- override the is_mobile_request? controller method to:

#controllers/application_controller.rb
def is_mobile_request?
  return false if request.user_agent.to_s.downcase =~/ipad/
  request.user_agent.to_s.downcase =~ /#{MOBILE_USER_AGENTS}/
end
Community
  • 1
  • 1
Jesse Wolgamott
  • 40,197
  • 4
  • 83
  • 109
0

As per the docs:

If you need to exclude one or more user agents from the mobile format, lets say ipad for example, you may use the :skip_user_agents option:

mobylette_config do |config|
  config[:skip_user_agents] = [:ipad]
end
sevenseacat
  • 24,699
  • 6
  • 63
  • 88
kelly
  • 1