similar to: How to identify the browser?

Displaying 20 results from an estimated 6000 matches similar to: "How to identify the browser?"

2006 Mar 21
4
Determining Browser?
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
2006 Feb 23
12
how to output something from within <% %> tags?
simple question: how do I output something from within <% %> tags? e.g. like ''echo'' in PHP. I thought it would be ''puts'' or ''print'' but neither seems to work. right now I always close the %> and open a <%= which is tedious. -- Posted via http://www.ruby-forum.com/.
2006 Feb 21
5
how to include an html file?
I have a bunch of html files with partial page content. I''d like to be able to include the content of these files in my RoR views without having to change or rename them. In PHP I''d simply use include("file.html"); What is the RoR equivalent of this? render_file insists on it being an rhtml template, and render_partial requires me to rename the file. Ideally, I
2006 Jun 13
7
ActiveRecord attribute= overload
I want to overload the = operator for one of the attributes in a model to run a filter on the input. However I can''t do this: def attribute=(data) self.attribute = filter(data) end because that creates an infinite recursive loop. How do I get around this? -- Posted via http://www.ruby-forum.com/.
2006 Apr 05
7
select_tag - populating options
Hello, I want to a select tag, where you can choose a number between 1 and 100. My inital code is based on the examples from Agile Web Development with Rails, and looks like this: view: <%= options = [["Select number of lines", ""]] + RfqLines::LINE_QTY select("rfq_line", "line_qty", options) %> model: LINE_QTY = select_fill def
2006 Apr 28
8
Effects fully display before effect
Why do effects that display an element (like Appear or Slide Down) start by displaying the element for a split second and then make the element disappear? _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
2006 Apr 20
7
AJAX/RJS Updating of Table Rows
I''m trying to update a table row (i.e. replace a <tr></tr>) using AJAX/RJS but of course this cannot be done in IE (works fine in Firefox). I have googled but have not found any solutions, only a lot of discussion. Does anyone have a solution to this problem? Cheers, Nicholas
2006 Apr 10
6
detecting browser type?
I''m wondering how i can detect the browser type for the client. I know this is possible, but i cant seem to find how to do this, nor any example code for this. I would appreciate if someone could point me to some info or just give me an explanation. thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Mar 05
7
whatever happend to unobtrusive javascript in Rails ?
Don''t get me wrong, JavaScript/Ajax helpers in Rails are a huge timesaver and they have helped me to finally overcome my irrational aversion to js libraries like prototype and such. However, all this goodness seems to come at quiet a price. The resulting code is littered with inline JS, including ubiquitous script tags and onload attributes etc.. It seems that just when i found
2006 Feb 25
7
generating HTML instead of XHTML
After reading http://www.hixie.ch/advocacy/xhtml and having some headaches with IE, I wonder whether helpers can be configured to generate HTML instead of XHTML. -- fxn
2006 Jun 14
1
Cross Browser Popups
Hi, Does anybody have a little cross-browser piece of code to resize a popup ? Excatly, I don''t know if it is possible ?, I would like to open a popup on the side of an existing window like if it would be a tabpane. So reducing window width by the width of the popup, set the popup on the side of the window. And the best of the best: when the window is resize, resizing the popup also
2006 Mar 07
1
Access flash from a model class?
I have a method that returns either a comment stored in the flash (if it exists) or a new comment. It works when I put it in my application controller: def preform_comment if flash[:badcomment].nil? comment = Comment.new return comment else return flash[:badcomment] end end However it would be cleaner to put this in the Comment model, so I tried: def
2006 Feb 28
1
Can I let routes.rb take precedence over file names?
I''d like Rails to intercept the url''s of html pages in a certain directory so I can embed them in my site. I put them in public/pages and tried to catch them with a route like map.connect ''pages/:pagename'' However this only works if the file does not exist; e.g. "pages/test.html" will only be routed if that file doesn''t exist,
2006 Mar 02
4
Instance variables in Javascript param
How can I make this work ? <a href="#" onclick="new Effect.Fade(@div_id)"></a> @div_id is an instance variable ? TIA -- Posted via http://www.ruby-forum.com/.
2006 Apr 07
1
[FYI] issues with integration testing
I was working on an integration test to test login/logout functionality and came across an issue that took me a bit to figure out. In one of my controllers, I have to test the request.env["HTTP_USER_AGENT"] value as a portion of the app will be access by Windows CE hand-helds. in the controllers index action i had the lines logger.info "user agent: " +
2006 Mar 22
5
foreach item in column
Hi there, I have a database with phonenumbers, and I want to make a function that runs a command for each of these numbers, with the number as an argument Something like this in Perl: system("/bin/command $number"); mysql> select * from numbers where list = "one" +----+----------+----------+---------------------+-----------+ | id | number | name | email
2004 Aug 06
3
icecast2 ogg vorbis client request headers
Can anyone shed some light as to what icecast2 accepts as a client request methods for ogg vorbis, apparently there is a difference bettween the way icecast2 handles mp3 and ogg vorbis. php example for mp3 that works fwrite($fp,"GET /mymp3 HTTP/1.1\nUser-Agent:$HTTP_USER_AGENT\n\n"); php example for ogg that doesnt work fwrite($fp,"GET /mymnt.ogg
2005 Oct 17
4
How to send excel file to browser (spreadsheat 0.3.2)
hey, i want to generate an excel file and send it directly to the browser (without storing it to the harddisk). does anyone has any solution? thanks in advance this is my code: -------------------- def export_excel if @request.env[''HTTP_USER_AGENT''] =~ /msie/i @headers[''Pragma''] = '''' @headers[''Cache-Control''] =
2006 Mar 07
2
redirect after validation
I have a difficulty with something that makes me think I don''t understand an aspect of Rails what. I''ve made a sort of blog site, and under each article I show the comments and a comment form. The comment model validates whether the user has entered his name. When he hasn''t, I want to send him back to the form with his comment text still there. In the comment/create
2008 Sep 30
4
Using the response object in stories
I have this statement in the layout of my application (using haml) - if request.env["HTTP_USER_AGENT"].include?("MSIE") = stylesheet_link_tag ''blueprint/ie.css'' = stylesheet_link_tag ''confirm_ie.css'' The problem is that request.env["HTTP_USER_AGENT"] is nil when I go to some page in the features I write with cucumber and webrat