add a link check

This commit is contained in:
chiu 2025-11-28 04:45:41 +00:00
parent 65c461a9b4
commit 07e361d4ae
1 changed files with 7 additions and 1 deletions

View File

@ -113,7 +113,13 @@
<% end %>
</td>
<td>
<a href="<%= page_for_archive_file(archive) %>" target="_blank"><%= archive.title %></a>
<% # 增加檢查,如果 archive.title 或 page_for_archive_file 失敗,則使用 safe_link %>
<% safe_link = (page_for_archive_file(archive) rescue nil) %>
<% if safe_link.present? %>
<a href="<%= safe_link %>" target="_blank"><%= archive.title %></a>
<% else %>
<%= archive.title %>
<% end %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if is_editable %>