I am using Ruby on Rails v3.0.9 and I would like to check if an image (in my case a favicon.ico
icon image) is successfully retrieved from a web site and if not I would like to display a custom image.
In order to retrieve the favicon.ico
image related to a web site, in my view file I have:
image_tag "#{web_site.link}/favicon.ico", :size => "16x16"
where web_site.link
values are something like the followings:
http://stackoverflow.com/
http://www.stackoverflow.com/
http://facebook.com/
...
How to check if an image was found on a web site (maybe using an if ... else ... end
statement or performing some HTTP request before to handle favicon images) and how to handle the above scenario?