I have a problem with adding image to web-page I try to use Webpack so I download images in application.js
const images = require.context('./assets/images/', true)
const imagePath = (name) => images(name, true)
after that i try to implement their in html.erb
<div class="modal-body"
<%= image_pack_tag 'calibration.png' %>
</div>
so, i have this error
what i do wrong? and what i need to do?
The problem is solved. My mistake was that I specified the wrong path; a correct variant is:
const images = require.context('../../assets/images', true)
After that, place the image in
public/packs/media/images/
so you can implement it in HTML in two ways:
<%= image_pack_tag 'media/images/name_of_image.png' %>
<img src="<%= asset_pack_path 'media/images/name_of_image.png' %>" width="100%" height="100%" alt=" demo instructions"></img>