% answers = Array(question.answer) %> <%= form.collection_check_boxes(:answer_array, question.input_options, :to_s, :to_s, {}, {class: ""}) do | option | %> <% option_id = "#{question.question_id}#{sanitize_to_id(option.value)}" checked = answers.include?(option.value) ? 'checked' : '' %>