Displaying 1 result from an estimated 1 matches for "selected_answer".
2008 Mar 23
1
radio buttons - how to identify record using value?
...a simple questionnaire app using RoR. I''ve got a model for
Questions, a model for Answers, and a third model, Qa, for matching each
question to five possible answers through foreign keys. So, each qa has
a question and five answers , a1-a5, through belongs_to and a
:foreign_key, and then a selected_answer field for specifying which
answer was selected by the user. The selected_answer is also an Answer
through a foreign key.
Here''s the question: What do I use for the value of the radio button?
I''ve tried the following:
<%= f.radio_button :selected_answer, :a1 %><%= @q...