If you're facing this issue, there are a few workarounds you can try out. One option is to change the filename and utilize the asset pipeline along with SCSS. In that case, simply rename the style file to .css.scss
and update the background property as follows:
background: image-url("bg-noise.png");
This will help in resolving the path automatically by using the image-url
SCSS helper.
Alternatively, you can rename the file to .css.erb
, which will allow you to embed ERB code within the stylesheet. Here's how you can modify the background-image property:
background-image: url(<%= asset_path 'bg-noise.png' %>)
Lastly, if none of the above options work for you, you could always resort to hard-coding the path like this:
background: url("/assets/bg-noise.png");
Out of these solutions, I recommend giving the first one a shot.