The asset pipeline is one of my favourite Rails 3.1 features. Assets — such as JavaScript and CSS files — are served as written in development mode. As a default, this is spot on but when debugging a rich app on IE9, I found some tuning needed. In particular, IE9 has a hard limit of 31 stylesheets. In this case, it's useful to switch on asset compilation in development. Read on to see how...
JSparklines is a cool JQuery plugin for drawing sparklines — small, in-line graphs. This library uses css injection. In development mode, IE9 raised an Invalid argument
error when this was called. A little bit cryptic, but after a little digging, the cause turned out to be that hard limit. Time to tinker.
To serve fully processed assets in development: edit config/environments/development.rb
, setting
config.assets.debug = false
Thanks Dennis Reimann for his clear example.
No comments:
Post a comment