Class: MetadataPresenter::AnswersController

Inherits:
EngineController show all
Defined in:
app/controllers/metadata_presenter/answers_controller.rb

Instance Method Summary collapse

Methods inherited from EngineController

#allow_analytics?, #analytics_cookie_name, #analytics_tags_present?, #answered?, #back_link, #external_or_relative_link, #load_autocomplete_items, #maintenance_mode?, #reload_user_data, #show_cookie_banner?

Instance Method Details

#createObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/metadata_presenter/answers_controller.rb', line 5

def create
  @previous_answers = reload_user_data.deep_dup
  @page_answers = PageAnswers.new(page, answers_params, autocomplete_items(page.components))

  upload_files if upload?

  if @page_answers.validate_answers
    save_user_data # method signature
    redirect_to_next_page
  else
    render_validation_error
  end
end