<% if eventable&.has_attachments? %> <% eventable.attachments.each do |attachment| %> <% variant = Attachments::VARIANTS[:small] %> <% width = attachment.metadata["width"] %> <% height = attachment.metadata["height"] %> <% if attachment.previewable? %> <%= image_tag url_for(attachment.preview(variant)), class: "attachment attachment--image", width: width, height: height %> <% elsif attachment.variable? %> <%= image_tag url_for(attachment.variant(variant)), class: "attachment attachment--image", width: width, height: height %> <% else %>
<%= attachment.filename.extension&.downcase.presence || "unknown" %>
<% end %> <% end %>
<% end %>