Ruby On Rails

Detecting Mobile Browser via Gem

Step 1: Install the gem ‘browser’ gem install browser Step 2: Add it to Gemfile or environment.rb gem “browser” #=> Rails 3 config.gem “browser” #=> Rails 2 Step 3: Implement require “browser” browser.name # readable browser name browser.safari? browser.opera? browser.chrome? browser.mobile? browser.tablet? browser.firefox? browser.ie? browser.ie6? # this goes up to 9 browser.capable? # supports some… Continue reading Detecting Mobile Browser via Gem