Module: AslonMobile2Helper

Defined in:
app/helpers/aslon_mobile2_helper.rb

Constant Summary collapse

MOBILE_USER_AGENTS =

List of mobile agents, from mobile_fu (github.com/brendanlim/mobile-fu)

'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'

Instance Method Summary collapse

Instance Method Details

#is_mobile_request?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/helpers/aslon_mobile2_helper.rb', line 13

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