HI, I have inherited support on a rails website and I am encountering
the following problem:
<% if @request.env['HTTP_USER_AGENT'].downcase.index('msie 6.0')!=nil %>
<%= stylesheet_link_tag 'ie6' %>
<% elsif
@request.env['HTTP_USER_AGENT'].downcase.index('msie 7.0')!=nil %>
<%= stylesheet_link_tag 'ie7' %>
<% else %>
<%= stylesheet_link_tag 'moz' %>
<% end %>
this little code snippet works except when the user agent string is
empty in which case i get : (undefined method `downcase' for
nil:NilClass)
how can i edit this code so that it can handle an empty user agent
string?
thanks
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.