Forum: Ruby on Rails How to identify the browser?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
39045f22049b1db3e3dd08c3bffac17e?d=identicon&s=25 Filip Godsmurf (godsmurf)
on 2006-03-02 15:00
I need to generate some browser-specific code; can I identify which
browser is being used from within my RoR code?
36958dd94ca666a38483df282a5214d5?d=identicon&s=25 Peter Ertl (Guest)
on 2006-03-02 16:32
(Received via mailing list)
39045f22049b1db3e3dd08c3bffac17e?d=identicon&s=25 Filip Godsmurf (godsmurf)
on 2006-03-02 16:42
Peter Ertl wrote:
> Check that out:
> http://www.quirksmode.org/js/support.html

Thanx but that's from within Javascript. I need to detect the browser
from within Rails. The reason is that IE needs a doctype declaration to
lay out my site properly, but in Firefox some of my javascripts don't
work anymore if I include a doctype. So I'd just like to send the
doctype to IE browsers.
36958dd94ca666a38483df282a5214d5?d=identicon&s=25 Peter Ertl (Guest)
on 2006-03-02 17:02
(Received via mailing list)
inside an action controller method:

redirect_to "http://www.microsoft.com" if
request.env["HTTP_USER_AGENT"].include?("MSIE")
This topic is locked and can not be replied to.