diff --git a/app/views/home/_arts.html.erb b/app/views/home/_arts.html.erb index a8302ca..840a6bc 100644 --- a/app/views/home/_arts.html.erb +++ b/app/views/home/_arts.html.erb @@ -3,7 +3,15 @@
<% if art.image.attached? %> - <%= image_tag art.preview_image.processed, class: "w-full h-full object-cover transform hover:scale-105 transition-transform duration-500" %> + <% begin %> + <%= image_tag art.preview_image&.processed, class: "w-full h-full object-cover transform hover:scale-105 transition-transform duration-500" %> + <% rescue StandardError => e %> + +
+

Something error.

+
+ <% Rails.logger.error("图片加载失败: #{e.message}") if defined?(Rails) %> + <% end %> <% end %>