Class: MetadataPresenter::PagesController

Inherits:
EngineController show all
Defined in:
app/controllers/metadata_presenter/pages_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, #get_saved_progress, #increment_record_counter, #invalidate_record, #load_autocomplete_items, #maintenance_mode?, #reload_user_data, #save_form_progress, #show_cookie_confirmation?, #show_cookie_request?

Instance Method Details

#answered_pagesObject



29
30
31
# File 'app/controllers/metadata_presenter/pages_controller.rb', line 29

def answered_pages
  TraversedPages.new(service, load_user_data, @page).all
end

#pages_presentersObject



20
21
22
23
24
25
26
# File 'app/controllers/metadata_presenter/pages_controller.rb', line 20

def pages_presenters
  PageAnswersPresenter.map(
    view: view_context,
    pages: answered_pages,
    answers: @user_data
  )
end

#showObject



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

def show
  @user_data = load_user_data # method signature
  @page ||= service.find_page_by_url(request.env['PATH_INFO'])

  if @page
    load_autocomplete_items

    @page_answers = PageAnswers.new(@page, @user_data)

    render template: @page.template
  else
    not_found
  end
end