def enable_resource_duplication_via_save
      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: :duplicate)
        end
      end

      member_action :duplicate do
        resource  = resource_class.find(params[:id])

        authorize! ActiveAdmin::Auth::CREATE, resource

        duplicate = resource.amoeba_dup
        if duplicate.save
          redirect_to({ action: :edit, id: duplicate.id }, flash: { notice: "#{active_admin_config.resource_label} was successfully duplicated." })
        else
          redirect_to({ action: :show }, flash: { error: "#{active_admin_config.resource_label} could not be duplicated." })
        end
      end
    end
def enable_resource_duplication_via_save
      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: :duplicate)
        end
      end

      member_action :duplicate do
        resource  = resource_class.find(params[:id])

        authorize! ActiveAdmin::Auth::CREATE, resource

        duplicate = resource.amoeba_dup
        if duplicate.save
          redirect_to({ action: :edit, id: duplicate.id }, flash: { notice: "#{active_admin_config.resource_label} was successfully duplicated." })
        else
          redirect_to({ action: :show }, flash: { error: "#{active_admin_config.resource_label} could not be duplicated." })
        end
      end
    end
Enables resource duplication via save.

 - Adds a duplicate action button.
 - Duplicates a resource, persists it, and redirects the user to edit
   the newly duplicated resource.

 No return.