<commit_before><%= 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 %>

  <div class="row">

    <div class="small-12 column">
      <%= f.text_field :title %>
    </div>

    <div class="small-12 column">
      <div class="file-name">
        <%= f.file_field :attachment, label: false, class: 'show-for-sr' %>
        <%= f.label :attachment, t("documents.form.attachment_label"), class: 'button hollow' %>
        <p><%= document_attachment_file_name(@document) %></p>
      </div>
    </div>

    <% if @document.errors.has_key?(:attachment) %>
      <div class="small-12 column">
        <div class="attachment-errors">
          <small class="error"><%= errors_on_attachment(@document)%></small>
        </div>
      </div>
    <% end %>

    <div class="actions small-12 medium-6 large-4 end column">
      <%= f.submit(t("documents.form.submit_button"), class: "button expanded") %>
    </div>
  </div>
<% end %><commit_msg>Add missing class to file input custom error to hide and show correctly.<commit_after><%= 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 %>

  <div class="row">

    <div class="small-12 column">
      <%= f.text_field :title %>
    </div>

    <div class="small-12 column">
      <div class="file-name">
        <%= f.file_field :attachment, label: false, class: 'show-for-sr' %>
        <%= f.label :attachment, t("documents.form.attachment_label"), class: 'button hollow' %>
        <p><%= document_attachment_file_name(@document) %></p>
      </div>
    </div>

    <% if @document.errors.has_key?(:attachment) %>
      <div class="small-12 column source-option-file">
        <div class="attachment-errors">
          <small class="error"><%= errors_on_attachment(@document)%></small>
        </div>
      </div>
    <% end %>

    <div class="actions small-12 medium-6 large-4 end column">
      <%= f.submit(t("documents.form.submit_button"), class: "button expanded") %>
    </div>
  </div>
<% end %>
{'fraction_non_alphanumeric': 0.17215088282504012, 'fraction_numerical': 0.008025682182985553, 'mean_word_length': 2.5870503597122303, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7639693', 'n_tokens_mistral': 813, 'n_tokens_neox': 749, 'n_words': 167}