Sha256: 37627aa36f26184e079dc406b69b58a18c386f0348702463ea6762946143b897

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

<%#
The following params are the variables that can be used in this partial.

@param form [Wallaby::FormBuilder] custom form object that adds a few helper methods and delegate missing methods to the view
@param object [Wallaby::ResourceDecorator] decorator instance which wraps the resource (e.g. ActiveRecord) instance
@param field_name [String] name of the field
@param value [Object] value of the field
@param metadata [Hash] metadata of the field
%>
<div class="form-group <%= form.error_class field_name %>">
  <%= form.label field_name, metadata[:label] %>
  <div class="row">
    <% if value.try(:attachment) %>
      <div class="col-sm-12">
        <%= link_to value.attachment.blob.filename, rails_blob_path(value) %>
      </div>
    <% end %>
    <div class="col-sm-12">
      <%= form.label field_name, class: 'btn btn-default' do %>
        <%= form.file_field field_name, class: 'sr-only' %>
        <%= fa_icon 'upload' %> <%= t 'labels.upload' %>
      <% end %>
    </div>
  </div>
  <%= form.error_messages field_name %>
  <%= hint_of metadata %>
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wallaby-6.1.0 app/views/wallaby/resources/form/_active_storage.html.erb
wallaby-6.0.2 app/views/wallaby/resources/form/_active_storage.html.erb
wallaby-6.0.1 app/views/wallaby/resources/form/_active_storage.html.erb