Sha256: 33657b58150ac3060ef015e16e924896e116e91750a7cfefed13146da78f0243

Contents?: true

Size: 863 Bytes

Versions: 3

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: "250x250>" } %>
  <% end %>
  <%= pluralize(attachments.count, 'Attached file') %>
<% else %>
0 Attached files
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
administrate-field-active_storage-0.2.0 app/views/fields/active_storage/_index.html.erb
administrate-field-active_storage-0.1.8 app/views/fields/active_storage/_index.html.erb
administrate-field-active_storage-0.1.7 app/views/fields/active_storage/_index.html.erb