Class: HelenaAdministration::ImportSurveysController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- HelenaAdministration::ImportSurveysController
- Defined in:
- app/controllers/helena_administration/import_surveys_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
rubocop:disable Metrics/MethodLength.
- #new ⇒ Object
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
rubocop:disable Metrics/MethodLength
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/helena_administration/import_surveys_controller.rb', line 11 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 |
#new ⇒ Object
5 6 7 8 |
# File 'app/controllers/helena_administration/import_surveys_controller.rb', line 5 def new t('.import') @import_survey_form = ImportSurveyForm.new end |