Commit iniziale di eminuxCRM: CRM Rails con pipeline, campagne email e Docker.
Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
class ImportsController < ApplicationController
|
||||
before_action :require_current_project!
|
||||
|
||||
def new
|
||||
@page_title = "Import CSV"
|
||||
end
|
||||
|
||||
def create
|
||||
unless params[:file].present?
|
||||
redirect_to new_import_path, alert: "Seleziona un file CSV." and return
|
||||
end
|
||||
|
||||
importer = CsvImport::Organizations.new(file: params[:file], user: current_user, project: current_project)
|
||||
|
||||
if params[:preview].present?
|
||||
@preview = importer.preview
|
||||
@page_title = "Anteprima import"
|
||||
render :preview and return
|
||||
end
|
||||
|
||||
@result = importer.import!
|
||||
@page_title = "Risultato import"
|
||||
render :result
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user