I have a Survey
model that has_many Questions
. I want some questions only to require an answer if another Question
is answered.
For example, If a question one question may be "Did you use the lesson plan for this week's lesson?", and and another may be "What week of the lesson plan did you use?", but it's clear that the latter would only be required to be filled out if the answer to the first one is "Yes." How can I make the validation of one Question
conditional on the response to another Question
?
My question is different from the one previously asked because it's conditional validation based on the fields of another instance of the model, not based on the model's own fields