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



26
27
28
# File 'app/controllers/metadata_presenter/pages_controller.rb', line 26

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

#pages_presentersObject



17
18
19
20
21
22
23
# File 'app/controllers/metadata_presenter/pages_controller.rb', line 17

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

#showObject



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

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