How to set dynamic background using active storage

How do I use active storage to dynamically set the background image CSS attribute of a div?

I tried this **

**

but image is not displayed

Try something like that. style="background-image: url(/assets/<%= @product.image.url %>)

What processor are you using for image. Is it carierwave, active storage, paperclip… You just need to find how to print the image url.

Hope this work.