Sha256: 6e12082679e2cb3727d82b82739a4ae20c14fc7e29fae7bea3c7738e7602174e

Contents?: true

Size: 675 Bytes

Versions: 2

Compression:

Stored size: 675 Bytes

Contents

module ApplicationHelper
      # List of mobile agents, from mobile_fu (https://github.com/brendanlim/mobile-fu)
      #
      MOBILE_USER_AGENTS =  'palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|' +
        'audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|' +
        'x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|' +
        'pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|' +
        'webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|' +
        'mobile|maemo|fennec'

  def is_mobile_request?
    request.user_agent.to_s.downcase =~ /#{MOBILE_USER_AGENTS}/
   end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aslon_mobile2-0.1.2 app/helpers/application_helper.rb
aslon_mobile2-0.1.1 lib/application_helper.rb