how to refer to a rails image asset in JSX and Rails 7 (esbuild)

191 Views Asked by At

Can't figure out how to get an asset path in JSX that is processed byjsbundling-rails/esbuild:

  <img src={`zone_icons/${zone}.png` }/>

I've seen that in the source code of cssbundling-rails the url() is gsubbed and urls are replaced with the whole asset path (with hash).

This doesn't seem to be the case for jsbundling with esbuild. Anyone know?

My only other recourse would be to use /public?

0

There are 0 best solutions below