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

前端 未结 4 1307
难免孤独
难免孤独 2021-02-07 20:01

Simple Rails app, mostly scaffolding. I want to detect whether the user is using Android or iPhone to access my app. What\'s the easiest way to do that?

4条回答
  •  孤独总比滥情好
    2021-02-07 20:46

    the user_agent gem is useful for mobile vs. desktop..., and browser version. but doesn't do anything for OS https://github.com/josh/useragent

提交回复
热议问题