Skip to content

Commit a1cf1c0

Browse files
committed
Adjust form_image_fields to render images and attachments, if those assns exist
1 parent 1b41095 commit a1cf1c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/views/shared/_form_image_fields.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
</div>
8282
</div>
8383

84-
<% if f.object.images.any? %>
84+
<% if f.object.respond_to?(:images) && f.object.images.any? %>
8585
<div class="bg-red-200 p-3 pb-9">
8686
<h3 class="text-lg font-medium mt-6 mb-2">
8787
Legacy Images (need to manually download and upload above, then remove)
@@ -122,7 +122,7 @@
122122
</div>
123123
<% end %>
124124

125-
<% if f.object.attachments.any? %>
125+
<% if f.object.respond_to?(:attachments) && f.object.attachments.any? %>
126126
<div class="bg-red-200 p-3 pb-9">
127127
<h3 class="text-lg font-medium mt-6 mb-2">
128128
Legacy Attachments (need to manually download and upload above, then remove)

0 commit comments

Comments
 (0)