render image as file

This commit is contained in:
Pete Matsyburka
2025-06-26 21:44:05 +03:00
parent bf2f5b24dc
commit cd477c880c
4 changed files with 13 additions and 8 deletions
+2 -2
View File
@@ -28,9 +28,9 @@
</div>
<% end %>
</div>
<% elsif field['type'].in?(['image', 'initials', 'stamp']) %>
<% elsif field['type'].in?(['image', 'initials', 'stamp']) && attachments_index[value].image? %>
<img class="object-contain mx-auto" src="<%= attachments_index[value].url %>" loading="lazy">
<% elsif field['type'].in?(['file', 'payment']) %>
<% elsif field['type'].in?(['file', 'payment', 'image']) %>
<autosize-field></autosize-field>
<div class="px-0.5 flex flex-col justify-center">
<% Array.wrap(value).each do |val| %>