% answer_string = answer.try(:answer) || answer %> <%= form.collection_radio_buttons(:answer, question.input_options, :to_s, :to_s, {}, {class: ""}) do | option | %> <% option_id = "#{question.question_id}#{sanitize_to_id(option.value)}" checked = answer_string == option.value ? 'checked' : '' %>