<h3>System Activity Logs</h3>

<%= render "log_filters" %>

<table id="logs" class="datatable table table-striped table-bordered" >
  <thead>
    <tr>
      <th>User</th>
      <th>Category</th>
      <th>Message</th>
      <th>Date</th>
    </tr>
  </thead>

  <tbody>
    <% @logs.each do |log| %>
      <tr>
        <td><%= log.user.present? ? log.user.fullname : "Unknown User" %></td>
        <td><%= log.category %></td>
        <td><%= log.message %></td>
        <td><%= log.created_at %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<h3>System Activity Logs</h3>

<%= render "log_filters" %>

<table id="logs" class="datatable table table-striped table-bordered" >
  <thead>
    <tr>
      <th>User</th>
      <th>Category</th>
      <th>Message</th>
      <th>Date</th>
    </tr>
  </thead>

  <tbody>
    <% @logs.each do |log| %>
      <tr>
        <td><%= log.user&.fullname || "Unknown User" %></td>
        <td><%= log.category %></td>
        <td><%= log.message %></td>
        <td><%= log.created_at %></td>
      </tr>
    <% end %>
  </tbody>
</table>

Move to more modern try syntax
Move to more modern try syntax