<h1>Country</h1>

<table class='table'>
  <thead>
    <th>Name</th>
    <th>Flag</th>

    <th colspan=3>Actions</th>
  </thead>
  <tbody>
    <% @countries.each do |country| %>
      <tr>
        <td><%= country.name %></td>
        <td>
          <%= image_tag country.flag.variant(resize_to_limit: [30, 30]) if country.flag.attached? && country.flag.image? %>
        </td>

        <td><%= link_to "Show", country_path(country) %></td>
        <td><%= link_to "Edit", edit_country_path(country) %></td>
        <td>
          <%= link_to "Delete", country_path(country),
            "data-turbo-method": :delete,
            "data-turbo-confirm": "Are you sure?" %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to "New country", new_country_path %>