私のビューにはさまざまな従業員の詳細が含まれており、それぞれの画像をアップロードして最後に保存する必要があります。保存する前に各画像の画像プレビューを表示したいのですが、ローカルホストパスを使用し、画像プレビューを表示しません。エラーが表示されています: "NetworkError:404 Not Found -localhost:3000 / rails.png"
ビューで
<% @person.each do |person| %>
<td><%= person.name %></td>
<td><%= person.date %></td>
<td><input id="<%= person.id %>" type='file' class="imageUploader" multiple="true" ></td>
<td class="image_container"> <img id="image_<%= person.id %>" src="#" alt="Image" width="100" height="100"></td>` here
</tr>
<% end %>
appliction.jsで::
$('.imageUploader').change(function() {
var target_image = $(this).val();
$(this).parent('td').parent("tr").children('td.image_container').html("<img src="+target_image+">");
console.log(target_image);
});