Browser detection for Rails