def enable_resource_duplication_via_form
      action_item(*compatible_action_item_parameters) do
        if controller.action_methods.include?('new') && authorized?(ActiveAdmin::Auth::CREATE, active_admin_config.resource_class)
          link_to(I18n.t(:duplicate_model, default: "Duplicate %{model}", scope: [:active_admin], model: active_admin_config.resource_label), action: :new, _source_id: resource.id)
        end
      end

      controller do
        before_action only: :new do
          if !params[:_source_id].blank?
            source = resource_class.find(params[:_source_id])
            @resource ||= source.amoeba_dup if source
          end
        end
      end
    end
def enable_resource_duplication_via_form
      action_item(*compatible_action_item_parameters) do
        if controller.action_methods.include?('new') && authorized?(ActiveAdmin::Auth::CREATE, active_admin_config.resource_class)
          link_to(I18n.t(:duplicate_model, default: "Duplicate %{model}", scope: [:active_admin], model: active_admin_config.resource_label), action: :new, _source_id: resource.id)
        end
      end

      controller do
        before_action only: :new do
          if !params[:_source_id].blank?
            source = resource_class.find(params[:_source_id])
            @resource ||= source.amoeba_dup if source
          end
        end
      end
    end
Enables resource duplication via new form.

 - Adds a duplicate action button.
 - Preloads a duplicated resource on `:new` to pre-fill the form fields.

 No return.