How to identify the browser?


I need to generate some browser-specific code; can I identify which
browser is being used from within my RoR code?


Peter E. wrote:

Check that out:

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.


Check that out:


inside an action controller method:

redirect_to “” if