<% yield %> <% form ||= current_fields_form options ||= {} other_options ||= {} %> <%= render 'shared/fields/field', form: form, method: method, helper: :file_field, options: options, other_options: other_options do %> <% content_for :field do %>
<%= form.hidden_field "#{method}_removal".to_sym, value: nil, data: {'fields--file-field-target': 'removeFileFlag'} %> <%= form.file_field method, class: 'file-upload hidden', direct_upload: true, data: {'fields--file-field-target': 'fileField', action: 'change->fields--file-field#handleFileSelected'} %>
<% if form.object.send(method).attached? %> <%= link_to url_for(form.object.send(method)), class: 'button download-file mr-3', data: {'fields--file-field-target': 'downloadFileButton'} do %> Download Current Document <% end %> <% end %> <% if form.object.send(method).attached? %>
Remove Current Document
<% end %>
Upload New Document
<% end %> <% end %>