% question.input_options.each_with_index do | option, i | option_id = "#{question.question_id}_#{i}" checkbox_html = {class: 'checkbox', id: "answer_#{option_id}", name: "answer[checkbox][]", checked: Array(question.answer).include?(option), data: { last: Array(question.answer).include?(option) ? 'checked' : '' } } answers = answer.try(:answer) || answer %>