Sprockets & IE styles #793

m4tm4t opened this Issue Feb 6, 2012 · 3 comments

2 participants


After a fresh installation, the output of stylesheet_link_tag for IE seems buggy:

<link href="/assets/application.css?body=1" media="screen" rel="stylesheet" type="text/css" />
  <!--[if IE 6]><link href="/assets/formtastic_ie6.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/ie6.css?body=1" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
  <!--[if IE 7]><link href="/assets/formtastic_ie7.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/ie7.css?body=1" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
  <%= stylesheet_link_tag "application" %>
  <!--[if IE 6]><%= stylesheet_link_tag 'ie6' %><![endif]-->
  <!--[if IE 7]><%= stylesheet_link_tag 'ie7' %><![endif]-->

And ie6/7.css

 *= require formtastic_ie6

/assets/ie6.css return style correctly, but why /assets/formtastic_ie6.css is linked too ?

Running on rails 3.2 & formtastic 2.0.2 (same on 2.1-stable)


This definitely looks like a bug or an odd behaviour, but it's not an issue with Formtastic, as stylesheet_link_tag is vanilla Rails and not touched by Formtastic. Looks to me like stylesheet_link_tag is outputting two link tags for you — formtastic_ie6.css and ie6.css. I don't know why though sorry. If you find the answer, please report back so we can improve the docs.


After some tries, that happens with config.assets.debug = true and has no effect in production

so it's just a "visual" issue in development



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment