Based on https://gist.github.com/jchunky/3444833
class QuizAnswer < ActiveRecord::Base
...
def user_answer_collection
return [] if !user_answer
user_answer.split(",")
end
def user_answer_collection=(values)
self.user_answer = values.join(",")
end
end
<%= f.input :user_answer_collection, :as => :check_boxes, :collection => possible_answers %>