Sha256: d99bb9b6a957fb745e956e9acbd99bbbe31475f3b26d5ce8f1a32d797ae44495

Contents?: true

Size: 763 Bytes

Versions: 4

Compression:

Stored size: 763 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
%>
<% if field.attached? %>
  <% if field.many? %>
    <% field.attachments.each do |attachment| %>
      <%= render :partial => 'fields/active_storage/item', locals: { field: field, attachment: attachment } %>
      <br/>
    <% end %>
  <% else %>
    <%= render :partial => 'fields/active_storage/item', locals: { field: field, attachment: field.data } %>
  <% end %>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
administrate-field-active_storage-0.1.5 app/views/fields/active_storage/_index.html.erb
administrate-field-active_storage-0.1.4 app/views/fields/active_storage/_index.html.erb
administrate-field-active_storage-0.1.3 app/views/fields/active_storage/_index.html.erb
administrate-field-active_storage-0.1.2 app/views/fields/active_storage/_index.html.erb