Class: MetadataPresenter::PagesController
Instance Method Summary
collapse
#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_pages ⇒ Object
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_presenters ⇒ Object
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
|
#show ⇒ Object
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 @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
|