I have the following class:
class Question < ActiveRecord::Base
serialize :choices
end
I want my questions to have a set of choices that the user can select, and I'm storing them inside the question record to avoid a second database query. I'm trying to set my form so that the text for each choice is editable by a user. This is the tag I'm using for the input:
<input name="question[choices][]" type="text" />
My permit function is this:
def question_params
params.require(:question).permit(:category_id, :content, :choices, :answer_id)
end
My choices array isn't getting set. What am I doing wrong here?