Sha256: 498285d06fa42aa303184f722395948d34e70d1bb93c4e7c47af750f9006b881

Contents?: true

Size: 882 Bytes

Versions: 1

Compression:

Stored size: 882 Bytes

Contents

<%#
# Image Form Partial

This partial renders an input element for image attributes.
By default, the input is a text field for the image's URL.

## Local variables:

- `f`:
  A Rails form generator, used to help create the appropriate input fields.
- `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
%>

<div class="field-unit__label">
  <%= f.label field.attribute %>
</div>

<div class="field-unit__field">
  <% if field.attached? %>
    <%= render partial: 'fields/active_storage/items', locals: { field: field, removable: field.destroyable? } %>
  <% end %>

  <div>
    <%= field.can_add_attachment? ? "Add:" : "Replace:" %>
    <%= f.file_field field.attribute, multiple: field.many?, direct_upload: field.direct? %>
  </div>
</div>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
administrate-field-active_storage-0.3.0 app/views/fields/active_storage/_form.html.erb