diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 3a05bf4..d5dc8a9 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -3,7 +3,11 @@
<% if @latest_arts.first&.image&.attached? %>
- <%= image_tag @latest_arts&.first&.webp_image&.processed, class: "w-full h-full object-cover" %> + <% begin %> + <%= image_tag @latest_arts&.first&.webp_image&.processed, class: "w-full h-full object-cover" %> + <% rescue StandardError => e %> + <% Rails.logger.error("图片加载失败: #{e.message}") if defined?(Rails) %> + <% end %>
<% end %>