Sha256: 8092c3fb79a9425ec25b0df5f6b2f1e69694129b7ff375a055115bc819c77bbe

Contents?: true

Size: 863 Bytes

Versions: 2

Compression:

Stored size: 863 Bytes

Contents

<%#
# Image Index Partial

This partial renders an image attribute
to be displayed on a resource's index page.

By default, the attribute is rendered as an image tag.

## Local variables:

- `field`:
  An instance of [Administrate::Field::Image][1].
  A wrapper around the image url pulled from the database.

[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Image
%>
<style> <%# figure out a way to remove this %>
  td img {
      max-height: unset !important;
  }
</style>
<% 
  attachments = Array(field.many? ? field.attachments : field.data)
%>
<% if field.attached? %>
  <% if field.show_in_index? %>
    <%= render partial: 'fields/active_storage/item', locals: { field: field, attachment: attachments[0], image_size: [250, 250] } %>
  <% end %>
  <%= pluralize(attachments.count, 'Attached file') %>
<% else %>
0 Attached files
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
administrate-field-active_storage-0.2.2 app/views/fields/active_storage/_index.html.erb
administrate-field-active_storage-0.2.1 app/views/fields/active_storage/_index.html.erb