RailsとWebpackerでassets配下の画像を使う

updated Sep 28, 2021created Sep 28, 2021

webpacker.ymlに読み込みの設定を書く

config/webpacker.yml
resolved_paths: ['app/assets/images']

Frontendで読み込み

js
<img src="~example.png">