I am developing a new web application in Rails 3.2. I have come to the point where I am trying to make everything look as nice in IE as Firefox/Chrome etc.
For that I am using CSS3 PIE http://css3pie.com/
However: Because of the way stylesheets are fragmented out in many small files, I now have 64 stylesheet files to load in development mode. This creates a problem in IE, when css3pie.htc tries to dynamically create a new styleshhet. IE only supports 31 concurrent stylesheets.
Is there a way to make Rails always concatenate all stylesheets into application.css? In development.
UPDATE 2012-04-11: I have tried to invoke “rake assets:precompile” on my development machine. But the precompiled stylesheet is still not used. It seems like I need to change some config values, but I do not know which.
Carsten
It sounds like your asset pipeline is in debug mode, so you’ll want to turn that off.You should have a
<AppDir>/config/environments/development.rbfile. In that file, try to find the following line.Try setting that value to
false(if the line isn’t in the file already, go ahead and add it with a value offalse). That will cause the asset pipeline to compile all your assets into a single file per manifestIf that doesn’t fix it, you may need to restructure your manifest files. I’d read through this section on the Asset Pipeline: Manifests and Directives to understand how the manifests are used and compiled.
You can also turn on compression if you want by adding/changing the following setting to true:
Note, that if you’re using custom compressors, you’ll also need to add those definitions as well:
A complete list of the config options for the asset pipeline can be found in the Rails Guides Documentation on Configuring Rails Applications: Configuring Assests.