Mobile detection for Ruby on Rails

A quick piece of code to have a mobile detection usable all over your rails application