title: Detect user agent in Rails 4 - read HTTP header
body: <p>I just switched from PHP to Ruby on Rails and was wondering if there was a way to detect the clients device/user agent (reading the HTTP header) in order to serve different versions of the site depending on the request it gets. In PHP I have been using <a href="https://github.com/serbanghita/Mobile-Detect" rel="noreferrer">Mobile Detect</a> to do so. The general idea is to only serve files that are needed for each particular version. Thats why a client side approach is not that effective.</p>
  
  <p>Is there a way to do something similar with Ruby 2.0.0 and Rails 4.0.0 ?</p>
  
  <p>Maybe there is a gem to handle cases like that?</p>