Submit social housing lettings and sales data (CORE)
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.
|
|
|
module ConditionalQuestionsHelper
|
|
|
|
def conditional_questions_for_page(page)
|
|
|
|
page["questions"].values.map { |question|
|
|
|
|
question["conditional_for"]
|
|
|
|
}.compact.map(&:keys).flatten
|
|
|
|
end
|
|
|
|
|
|
|
|
def display_question_key_div(page_info, question_key)
|
|
|
|
"style='display:none;'".html_safe if conditional_questions_for_page(page_info).include?(question_key)
|
|
|
|
end
|
|
|
|
end
|