Is there a way I can read the user agent or something similar to determine whether the person is using IE, Mozilla/Netscape, Opera, Safari, etc? I want to dynamically output the CSS to the browser, but I''d like to change certain things (in this case the widths of some divs since IE adds borders and padding size to the total size of a div unlike firefox). Thanks, - Brent
check that... if (request.env[''HTTP_USER_AGENT''].include?("IE")) #internet explorer end By the way: could you invite me to gmail? Regards Peter> --- Urspr?ngliche Nachricht --- > Von: "Brent Johnson" <bljohnson@gmail.com> > An: rails@lists.rubyonrails.org > Betreff: [Rails] Determining Browser? > Datum: Tue, 21 Mar 2006 14:53:34 -0500 > > Is there a way I can read the user agent or something similar to > determine whether the person is using IE, Mozilla/Netscape, Opera, > Safari, etc? I want to dynamically output the CSS to the browser, but > I''d like to change certain things (in this case the widths of some > divs since IE adds borders and padding size to the total size of a div > unlike firefox). > > Thanks, > > - Brent > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
here''s a (somehow boring) list of browser id''s http://www.zytrax.com/tech/web/browser_ids.htm> --- Urspr?ngliche Nachricht --- > Von: "Peter Ertl" <pertl@gmx.org> > An: rails@lists.rubyonrails.org > Betreff: Re: [Rails] Determining Browser? > Datum: Tue, 21 Mar 2006 21:03:25 +0100 (MET) > > check that... > > if (request.env[''HTTP_USER_AGENT''].include?("IE")) > #internet explorer > end > > > By the way: could you invite me to gmail? > > Regards > Peter > > > > --- Urspr?ngliche Nachricht --- > > Von: "Brent Johnson" <bljohnson@gmail.com> > > An: rails@lists.rubyonrails.org > > Betreff: [Rails] Determining Browser? > > Datum: Tue, 21 Mar 2006 14:53:34 -0500 > > > > Is there a way I can read the user agent or something similar to > > determine whether the person is using IE, Mozilla/Netscape, Opera, > > Safari, etc? I want to dynamically output the CSS to the browser, but > > I''d like to change certain things (in this case the widths of some > > divs since IE adds borders and padding size to the total size of a div > > unlike firefox). > > > > Thanks, > > > > - Brent > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Thanks, thats quit an extensive list. I really only care about IE, Firefox/Mozilla/Netscape, Opera and Safari. But how do I read the user agent in RoR? I checked the request object and poked around searching the wiki and I can''t find a way. I''m sure there is, I''m just looking over it I think. - Brent On 3/21/06, Peter Ertl <pertl@gmx.org> wrote:> here''s a (somehow boring) list of browser id''s > > http://www.zytrax.com/tech/web/browser_ids.htm > > > > --- Urspr?ngliche Nachricht --- > > Von: "Peter Ertl" <pertl@gmx.org> > > An: rails@lists.rubyonrails.org > > Betreff: Re: [Rails] Determining Browser? > > Datum: Tue, 21 Mar 2006 21:03:25 +0100 (MET) > > > > check that... > > > > if (request.env[''HTTP_USER_AGENT''].include?("IE")) > > #internet explorer > > end > > > > > > By the way: could you invite me to gmail? > > > > Regards > > Peter > > > > > > > --- Urspr?ngliche Nachricht --- > > > Von: "Brent Johnson" <bljohnson@gmail.com> > > > An: rails@lists.rubyonrails.org > > > Betreff: [Rails] Determining Browser? > > > Datum: Tue, 21 Mar 2006 14:53:34 -0500 > > > > > > Is there a way I can read the user agent or something similar to > > > determine whether the person is using IE, Mozilla/Netscape, Opera, > > > Safari, etc? I want to dynamically output the CSS to the browser, but > > > I''d like to change certain things (in this case the widths of some > > > divs since IE adds borders and padding size to the total size of a div > > > unlike firefox). > > > > > > Thanks, > > > > > > - Brent > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Oops, sorry! Didn''t see this response since gmail folded it up, and yes, invite sent. Thanks! - Brent On 3/21/06, Peter Ertl <pertl@gmx.org> wrote:> check that... > > if (request.env[''HTTP_USER_AGENT''].include?("IE")) > #internet explorer > end > > > By the way: could you invite me to gmail? > > Regards > Peter > > > > --- Urspr?ngliche Nachricht --- > > Von: "Brent Johnson" <bljohnson@gmail.com> > > An: rails@lists.rubyonrails.org > > Betreff: [Rails] Determining Browser? > > Datum: Tue, 21 Mar 2006 14:53:34 -0500 > > > > Is there a way I can read the user agent or something similar to > > determine whether the person is using IE, Mozilla/Netscape, Opera, > > Safari, etc? I want to dynamically output the CSS to the browser, but > > I''d like to change certain things (in this case the widths of some > > divs since IE adds borders and padding size to the total size of a div > > unlike firefox). > > > > Thanks, > > > > - Brent > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >