<commit_before>module ContextualLinkHelpers
  # CRUD helpers
  def action_to_icon(action)
    case action.to_s
    when 'new'
      "plus"
    when 'show'
      "eye-open"
    when 'edit'
      "edit"
    when 'delete'
      "trash"
    when "index", "list"
      "list-alt"
    when "update"
      "refresh"
    when "copy"
      "repeat"
    else
      action
    end
  end

  def icon_link_to(action, url = nil, options = {})
    classes = []
    if class_options = options.delete(:class)
      classes << class_options.split(' ')
    end

    classes << I18nRailsHelpers.contextual_link_class

    if action.is_a? Symbol<commit_msg>Use trash icon for destroy action.<commit_after>module ContextualLinkHelpers
  # CRUD helpers
  def action_to_icon(action)
    case action.to_s
    when 'new'
      "plus"
    when 'show'
      "eye-open"
    when 'edit'
      "edit"
    when 'delete', 'destroy'
      "trash"
    when "index", "list"
      "list-alt"
    when "update"
      "refresh"
    when "copy"
      "repeat"
    else
      action
    end
  end

  def icon_link_to(action, url = nil, options = {})
    classes = []
    if class_options = options.delete(:class)
      classes << class_options.split(' ')
    end

    classes << I18nRailsHelpers.contextual_link_class

    if action.is_a? Symbol
{'fraction_non_alphanumeric': 0.10736196319018405, 'fraction_numerical': 0.003067484662576687, 'mean_word_length': 2.329081632653061, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, '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': '1870058', 'n_tokens_mistral': 445, 'n_tokens_neox': 440, 'n_words': 107}