Just want to announce my auto_sprite gem which some of you may find
It makes using CSS sprites painless. As a bonus - should you remove it
day, it doesn’t break you app, it just reverts to tags…
Full docs are at http://fargle.org/auto_sprite
In a pinch:
Include the stylesheet in your layout:
<%= stylesheet_link_tag “auto_sprite” %>
Create a directory called sprites in your images directory (e.g.
Put the images you want to link to in your public/images/sprites
Use your images like you normally would:
<%= image_tag â€˜sprites/logo.pngâ€™ %>
<%= image_tag â€˜sprites/icon1.jpgâ€™ %>
5. Reload you application and enjoy your now faster website.