Is there a way to detect user agent in Rails 3.1 [duplicate] August 21, 2023 by Tarik Yep, just use this request.env["HTTP_USER_AGENT"] #or request.user_agent