<commit_before>ActiveAdmin.register StepsUnit do
  permit_params(
    :step_id,
    :unit_id,
    :position,
    :from_en,
    :to_en,
    :from_ru,
    :to_ru
  )

  form do |f|
    f.inputs "Unit Details" do
      f.input :step, as: :select, collection: Step.all.map { |m| [m.title, m.id] }
      f.input :unit, as: :select, collection: Unit.all.map { |m| [m.slug, m.id] }
      f.input :position
      f.input :from_en
      f.input :to_en
      f.input :from_ru
      f.input :to_ru
    end
    f.actions
  end

  index do
    selectable_column
    column :step
    column :unit
    column :position
    column :from_en
    column :to_en
    column :from_ru
    column :to_ru
    actions
  end

  action_item :new, only: :show do
   link_to I18n.t('active_admin.new_model', model: active_admin_config.resource_label), new_resource_path<commit_msg>Convinient way to add step units<commit_after>ActiveAdmin.register StepsUnit do
  permit_params(
    :step_id,
    :unit_id,
    :position,
    :from_en,
    :to_en,
    :from_ru,
    :to_ru
  )

  form do |f|
    f.inputs "Unit Details" do
      f.input :step, as: :select, collection: Step.all.order('id DESC').map { |m| [m.title, m.id] }, selected: Step.last.id
      f.input :unit, as: :select, collection: Unit.all.order('id DESC').map { |m| [m.slug, m.id] }, selected: Unit.last.id
      f.input :position
      f.input :from_en
      f.input :to_en
      f.input :from_ru
      f.input :to_ru
    end
    f.actions
  end

  index do
    selectable_column
    column :step
    column :unit
    column :position
    column :from_en
    column :to_en
    column :from_ru
    column :to_ru
    actions
  end

  action_item :new, only: :show do
   link_to I18n.t('active_admin.new_model', model: active_admin_config.resource_label), new_resource_path
{'fraction_non_alphanumeric': 0.11203549639489739, 'fraction_numerical': 0.0022185246810870773, 'mean_word_length': 2.608, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1322426', 'n_tokens_mistral': 678, 'n_tokens_neox': 671, 'n_words': 166}