Usage of asset_url helper in Haml

Hi,

I would like to make use of the asset pipeline with enabled cache buster (activate :asset_hash).

This works fine for me for template helpers like ‘image_tag’ – but there are some cases where I would need helpers like ‘asset_url’ or ‘stylesheet_url’ in Haml.

for example, I tried:

%img{ data: { src: asset_url("dummy.jpg") }}

How am I supposed to refer to images with a checksum within data attributes?

Any hint on this topic would be highly appreciated!

OK, got it – from the reference:

Now, refer to your assets as normal, with their original filename.

This means for the mentioned example:

%img(data-src="dummy.jpg")