Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Nov 15, 2012
@noctivityinc noctivityinc fixed is_tablet_device method d159182
@benlangfeld Merge pull request #25 from noctivityinc/master
Fixed is_tablet_device? to work with Ruby 1.9.3
1115f77
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/mobile-fu.rb
View
12 lib/mobile-fu.rb
@@ -70,11 +70,11 @@ def has_mobile_fu(set_request_format = true)
# Add this to your controllers to prevent the mobile format from being set for specific actions
# class AwesomeController < ApplicationController
# has_no_mobile_fu_for :index
- #
+ #
# def index
# # Mobile format will not be set, even if user is on a mobile device
# end
- #
+ #
# def show
# # Mobile format will be set as normal here if user is on a mobile device
# end
@@ -139,12 +139,12 @@ def in_tablet_view?
# Returns either true or false depending on whether or not the user agent of
# the device making the request is matched to a device in our regex.
- def is_mobile_device?
- !is_tablet_device? && !!mobile_device
+ def is_tablet_device?
+ !!(request.user_agent.to_s.downcase =~ Regexp.new(ActionController::MobileFu::TABLET_USER_AGENTS))
end
- def is_tablet_device?
- request.user_agent.to_s.downcase =~ Regexp.new(ActionController::MobileFu::TABLET_USER_AGENTS)
+ def is_mobile_device?
+ !is_tablet_device? && !!mobile_device
end
def mobile_device

No commit comments for this range

Something went wrong with that request. Please try again.