def create
      @import_survey_form = ImportSurveyForm.new import_survey_form_params
      if @import_survey_form.valid?
        begin
          Helena::SurveyImporter.new @import_survey_form.script
          flash[:success] = t('shared.actions.created')
          redirect_to surveys_path
        rescue StandardError => e
          @error = e

          render 'new'
        end
      else
        flash.now[:danger] = t('shared.actions.error')
        render 'new'
      end
    end
def create
      @import_survey_form = ImportSurveyForm.new import_survey_form_params
      if @import_survey_form.valid?
        begin
          Helena::SurveyImporter.new @import_survey_form.script
          flash[:success] = t('shared.actions.created')
          redirect_to surveys_path
        rescue StandardError => e
          @error = e

          render 'new'
        end
      else
        flash.now[:danger] = t('shared.actions.error')
        render 'new'
      end
    end
rubocop:disable Metrics/MethodLength