Sha256: 5867160db77ffd15f117f03a69a4648752b41f761d526cc1708d7afa04f772ee

Contents?: true

Size: 479 Bytes

Versions: 4

Compression:

Stored size: 479 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-indigo-500 underline" %>
    <% end %>
  <% end %>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
madmin-1.2.9 app/views/madmin/fields/attachments/_show.html.erb
madmin-1.2.8 app/views/madmin/fields/attachments/_show.html.erb
madmin-1.2.7 app/views/madmin/fields/attachments/_show.html.erb
madmin-1.2.6 app/views/madmin/fields/attachments/_show.html.erb