<%= form_for @document, url: documents_path( documentable_type: @document.documentable_type, documentable_id: @document.documentable_id, from: params[:from] ), html: { multipart: true } do |f| %> <%= render 'shared/errors', resource: @document %>
<%= f.text_field :title %>
<%= f.file_field :attachment, accept: accepted_content_types_extensions(@document.documentable), label: false, class: 'show-for-sr' %> <%= f.label :attachment, t("documents.form.attachment_label"), class: 'button hollow' %>

<%= document_attachment_file_name(@document) %>

<% if @document.errors.has_key?(:attachment) %>
<%= errors_on_attachment(@document)%>
<% end %>
<%= f.submit(t("documents.form.submit_button"), class: "button expanded") %>
<% end %>