In the folder assets/images/default/user I stored an image banner.png.
How can I add this image direct in the following background-image?
<div class="banner-img" style="background-image: url('/assets/default/users/banner.png');"></div>
Rails Assets: Rails Assets Doc.
asset-url("rails.png") becomes url(/assets/rails.png)
asset-path("rails.png") becomes "/assets/rails.png"
In your case supposed to be like this:
url(<%= asset_path 'banner.png' %>)
url(<%= asset_path 'banner.png' %>)