Sha256: 6e7a2479cd74e1c57ba8ee7c8df9d80c43d27de65cb8a0cf9670b146413cc556

Contents?: true

Size: 477 Bytes

Versions: 3

Compression:

Stored size: 477 Bytes

Contents

<% if (attachments = field.value(record)) && attachments.attached? %>
  <% attachments.each do |attachment| %>
    <% if attachment.variable? %>
      <%= link_to main_app.url_for(attachment), target: :_blank do %>
        <%= image_tag main_app.url_for(attachment), class: "max-h-32" %>
      <% end %>
    <% else %>
      <%= link_to attachment.filename, main_app.url_for(attachment), target: :_blank, class: "text-blue-500 underline" %>
    <% end %>
  <% end %>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
madmin-2.0.0 app/views/madmin/fields/attachments/_show.html.erb
madmin-1.2.11 app/views/madmin/fields/attachments/_show.html.erb
madmin-1.2.10 app/views/madmin/fields/attachments/_show.html.erb