Find_user_agent is a project mainly written in RUBY and JAVASCRIPT, it's free.
Find the web browser user agent
In rails 3 Finding user agent is a easy way :)
By adding the one line in the controller page, we can get the UA.(@user_agent = request.env['HTTP_USER_AGENT'])
In /app/controllers/users_controller.rb
def index
@users = User.all @user_agent = request.env['HTTP_USER_AGENT']
In /app/views/users/index.html.erb
<%= @user_agent %>
That's All :)