One way to detect browsers is the ‘browser’ gem available at https://github.com/fnando/browser
This is how to set it up in Sinatra (which isn’t so obvious in the gem’s README):
require "browser"
browser = Browser.new(:ua => request.user_agent)
One way to detect browsers is the ‘browser’ gem available at https://github.com/fnando/browser
This is how to set it up in Sinatra (which isn’t so obvious in the gem’s README):
require "browser"
browser = Browser.new(:ua => request.user_agent)