Skip to content

Commit

Permalink
fixed is_tablet_device method
Browse files Browse the repository at this point in the history
  • Loading branch information
noctivityinc committed Nov 15, 2012
1 parent d442479 commit d159182
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/mobile-fu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d159182

Please sign in to comment.