You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
744 B
25 lines
744 B
class FormController < ApplicationController |
|
|
|
FIRST_QUESTION_FOR_SUBSECTION = { |
|
"Household characteristics" => "case_logs/household/tenant_code", |
|
"Household situation" => "case_logs/household_situation/previous_housing_situation" |
|
} |
|
|
|
NEXT_QUESTION = { |
|
"tenant_code" => "case_logs/household/tenant_age", |
|
"tenant_age" => "case_logs/household/tenant_gender", |
|
"tenant_gender" => "case_logs/household/tenant_ethnic_group", |
|
"tenant_ethnic_group" => "case_logs/household/tenant_nationality" |
|
} |
|
|
|
|
|
def next_question |
|
subsection = params[:subsection] |
|
result = if subsection |
|
FIRST_QUESTION_FOR_SUBSECTION[subsection] |
|
else |
|
NEXT_QUESTION[params[:previous_question]] |
|
end |
|
render result |
|
end |
|
end
|
|
|