detecting IE in HTML; Where to place favicon.ico?

I am suffering from a strange, uh, bug.

I have some html that the W3C W3C Markup Validation Service says has zero problems.

I have some images placed into table cells. This works perfectly on IE8, Chrome, Firefox, and Safari. But ...

When I add the following single haml line to the head   %link{'rel' => "shortcut icon", 'href' => "/images/UltraDedup-      icon-003---16x16.ico", 'type' => "image/x-icon"} then the images get displaced on the web page on IE8. The other browsers continue to work perfectly.

- - -

The above haml line generates the following html:   <link href='/images/UltraDedup-icon-003---16x16.ico'   rel='shortcut icon'   type='image/x-icon' />

- - -

I assume that I am experiencing an IE8 bug and/or incompatibility.

I have the following questions:

1) What is the rails and/or haml way to generate html that tests if it is running IE and suppresses the above link if it is? Can this be done via javascript?

2) Where do I put the favicon.ico (== /images/UltraDedup-icon-003---16x16.ico) file in the rails tree structure so that IE finds it without needing the link statement that seems to screw things up?

3) IE8 seems to cache the shortcut icon (favicon.ico). How do I clear that so that I get the latest and greatest?