What's the easiest way to detect the user's operating system in Rails 3? -


simple rails app, scaffolding. want detect whether user using android or iphone access app. what's easiest way that?

if request.env['http_user_agent'].downcase.match(/android|iphone/)   puts "yup, mobile" end 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -