|
|
@ -74,15 +74,19 @@ class Form |
|
|
|
def next_page_redirect_path(page, log, current_user) |
|
|
|
def next_page_redirect_path(page, log, current_user) |
|
|
|
nxt_page = next_page(page, log, current_user) |
|
|
|
nxt_page = next_page(page, log, current_user) |
|
|
|
if nxt_page == :check_answers |
|
|
|
if nxt_page == :check_answers |
|
|
|
"#{type}_log_#{subsection_for_page(page).id}_check_answers_path" |
|
|
|
log.not_started? ? "#{type}_log_new_#{subsection_for_page(page).id}_check_answers_path" : "#{type}_log_#{subsection_for_page(page).id}_check_answers_path" |
|
|
|
else |
|
|
|
else |
|
|
|
log.id ? "#{type}_log_#{nxt_page}_path" : "#{type}_log_new_#{nxt_page}_path" |
|
|
|
log.not_started? ? "#{type}_log_new_#{nxt_page}_path" : "#{type}_log_#{nxt_page}_path" |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def cancel_path(page, log) |
|
|
|
def cancel_path(page, log) |
|
|
|
|
|
|
|
if log.not_started? |
|
|
|
|
|
|
|
"#{log.class.name.underscore}_new_#{page.subsection.id}_check_answers_path" |
|
|
|
|
|
|
|
else |
|
|
|
"#{log.class.name.underscore}_#{page.subsection.id}_check_answers_path" |
|
|
|
"#{log.class.name.underscore}_#{page.subsection.id}_check_answers_path" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def next_incomplete_section_redirect_path(subsection, log) |
|
|
|
def next_incomplete_section_redirect_path(subsection, log) |
|
|
|
subsection_ids = subsections.map(&:id) |
|
|
|
subsection_ids = subsections.map(&:id) |
|
|
|