Fix issues

Issue 1 Fixed - Template now carries rows_to_skip.
  Issue 2 Fixed - Column headers refresh when rows_to_skip changes.
This commit is contained in:
sokie
2026-01-13 13:35:38 +01:00
parent accdbb799b
commit 7297554a55
4 changed files with 26 additions and 7 deletions

View File

@@ -8,10 +8,15 @@ class Import::ConfigurationsController < ApplicationController
def update
@import.update!(import_params)
@import.generate_rows_from_csv
@import.reload.sync_mappings
redirect_to import_clean_path(@import), notice: "Import configured successfully."
if params[:refresh_only]
redirect_to import_configuration_path(@import)
else
@import.generate_rows_from_csv
@import.reload.sync_mappings
redirect_to import_clean_path(@import), notice: t(".success")
end
rescue ActiveRecord::RecordInvalid => e
message = e.record.errors.full_messages.to_sentence.presence || e.message
redirect_back_or_to import_configuration_path(@import), alert: message