I need to generate some browser-specific code; can I identify which browser is being used from within my RoR code? -- Posted via http://www.ruby-forum.com/.
Check that out: http://www.quirksmode.org/js/support.html> --- Urspr?ngliche Nachricht --- > Von: Filip Godsmurf <krommenaas@gmail.com> > An: rails@lists.rubyonrails.org > Betreff: [Rails] How to identify the browser? > Datum: Thu, 2 Mar 2006 15:00:40 +0100 > > I need to generate some browser-specific code; can I identify which > browser is being used from within my RoR code? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Peter Ertl wrote:> Check that out: > http://www.quirksmode.org/js/support.htmlThanx 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. -- Posted via http://www.ruby-forum.com/.
inside an action controller method: redirect_to "http://www.microsoft.com" if request.env["HTTP_USER_AGENT"].include?("MSIE")> --- Urspr?ngliche Nachricht --- > Von: Filip Godsmurf <krommenaas@gmail.com> > An: rails@lists.rubyonrails.org > Betreff: [Rails] Re: How to identify the browser? > Datum: Thu, 2 Mar 2006 16:42:44 +0100 > > 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. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >