I was trying to use
in my .scss files in the same fashion as asset-path() or image-url(), but it seems such helper is missing (Sprockets provides asset_data_uri). Possible to add?
+1 this would be great.
I've made a pull request:
For the time being, here's something you can stick in an initializer:
Just for anyone else who might run into this: note that the method is called asset-data-url, with an L at the end instead of the i ("uri") mentioned in the original post here.
@florish Thanks for pointing this out, without your comment I would have given up. It is bizarre that sass-rails has renamed this method, given that both the formal name for the format is Data URI (http://en.wikipedia.org/wiki/Data_URI_scheme) and the Rails feature is called asset-data-uri (http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets)
Unless I'm missing something this feature name is very confusing. Can you at least create an alias for asset-data-uri to be congruent with Rails?
@klebba I agree, it is quite confusing. Maybe you should open a new issue (with a reference to this one), as the one we're on now has been closed for 2 years and probably isn't monitored by any of the developers anymore...