Sha256: 0d78631ba2810b031243a33049ade7e6b6c42464fc14a7d7df9bb74b6076db70
Contents?: true
Size: 1.28 KB
Versions: 11
Compression:
Stored size: 1.28 KB
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.drop_js? %> <!-- Form dropJS --> <%= render partial: 'fields/active_storage/dropjs_items', locals: { f: f, field: field, removable: field.destroyable? } %> <%else %> <!-- Form if no dropJS --> <%= f.file_field field.attribute, multiple: field.many?, direct_upload: field.direct? %> <%end %> <!-- show previous images recorded --> <% if field.attached? %> <% if !field.drop_js? %> <%= render partial: 'fields/active_storage/items', locals: { field: field, removable: field.destroyable? } %> <%= field.can_add_attachment? ? "Add:" : "Replace:" %> <%else %> <%= render partial: 'fields/active_storage/items', locals: { field: field, removable: field.destroyable? } %> <%end %> <% end %> </div>
Version data entries
11 entries across 11 versions & 1 rubygems