I am trying to find out how to know the name of the image which is generated using compass-rails.
Here what i`ve got in my .sass stylesheet:
$asset-path: "/assets/"
@import "../images/icons/*.png"
@include all-icons-sprites
.icons-sprite,
.icons-doc,
.icons-enroll
background: url('#{$asset-path}icons-s604efe6938.png') no-repeat
The image was called icons-s604efe6938.png when i used compass locally.
How to know how will it be called now on rails?
The folks at Compass can't think of a reason why a developer would need to know the filename of the generated sprite, as mentioned here. I can think of one: pre-loading the sprites with an img tag and capturing the onload event.
Seems like the best possible option is to hack Compass to keep it from generating the random string it appends at the end of the file. See here:
How to remove the hash from Compass's generated sprite image filenames?
Then you'll know the exact name of the generated sprite, which you can reference in your css urls or img src's.