Class: MetadataPresenter::SubmissionsController

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

Instance Method Summary collapse

Methods inherited from EngineController

#allow_analytics?, #analytics_cookie_name, #analytics_tags_present?, #answered?, #authorised_session!, #back_link, #external_or_relative_link, #get_saved_progress, #increment_record_counter, #invalidate_record, #load_autocomplete_items, #load_page_content, #maintenance_mode?, #reload_user_data, #require_basic_auth, #save_form_progress, #session_authorised?, #show_cookie_confirmation?, #show_cookie_request?

Instance Method Details

#createObject



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

def create
  @page = service.confirmation_page

  if @page
    if params[:save_for_later_check_answers].present?
      # this flag is sent by the check answers page, and we don't want to submit & validate here
      redirect_to save_path(page_slug: params[:page_slug]) and return
    end

    create_submission
    redirect_to_page @page.url
  else
    not_found
  end
end

#create_save_and_return_submission(payload) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/controllers/metadata_presenter/submissions_controller.rb', line 30

def create_save_and_return_submission(payload)
  # The runner is the only app that sends the save and return submission.
  # and it is not needed on the editor app (editing & previewing).
  # So in the Runner we defined the #create_save_and_return_submission in the parent
  # controller and in the Editor we don't.
  #
  # :nocov:
  if defined?(super)
    super
  end
  # :nocov:
end

#create_submissionObject



19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/metadata_presenter/submissions_controller.rb', line 19

def create_submission
  # The runner is the only app that sends the submission.
  # and it is not needed on the editor app (editing & previewing).
  # So in the Runner we defined the #create_submission in the parent
  # controller and in the Editor we don't.
  #
  if defined?(super)
    super
  end
end