<commit_before><% content_for :head do %>
  <script type="text/javascript" charset="utf-8">
    $(document).ready(function(){
      var myTextArea = $('textarea.tagme').tagify();

      myTextArea.tagify('inputField').autocomplete({
        source: <%= raw resource_class.tag_counts.collect { |t| t.name } %>,
        position: { of: myTextArea.tagify('containerDiv') },
        close: function(event, ui) { myTextArea.tagify('add'); },
      });

      $('textarea.tagme').closest("form").submit( function() {
        $('textarea').tagify('serialize');
      });
    });
  </script>
  <style type="text/css" media="all">
    .ui-autocomplete {width:296px;}
  </style>
<% end %>

<%= f.input :tag_list, as: :text, input_html: { class: "tagme" } %>

<commit_msg>Fix for dodgy tags, and allow for other tag field names.<commit_after><% id = "koi-#{ new_uuid }" %>

<% content_for :head do %>
  
  <script type="text/javascript" charset="utf-8">
  
    $ (document).ready (function ()
    {
      var input = $ ('#<%= id %>')

      input.tagify ()

      input.tagify ('inputField').autocomplete ({

        source: <%= raw resource_class.tag_counts_on(attr).collect { |t| t.name } %>
      
      , position: { of: input.tagify ('containerDiv') }
      
      , close: function (event, ui) { input.tagify ('add') }
      
      })

      input.closest ('form').submit (function (e)
      {
        input.tagify ('serialize')
      })

    })
  </script>

  <style type="text/css" media="all">
    .ui-autocomplete { width : 296px; }
  </style>
<% end %>

<%= f.input attr, as: :text, input_html: { id: id } %>

{'fraction_non_alphanumeric': 0.19825978868862648, 'fraction_numerical': 0.004972032318210068, 'mean_word_length': 2.797169811320755, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '4147029', 'n_tokens_mistral': 577, 'n_tokens_neox': 535, 'n_words': 107}