Hi,
Am creating a survey, in which am getting the questions from question
table and answers from answers table.
In the survey table am displaying the questions with the answers as
multiple choice using radio buttons.
Also while selcting the option the vote_count should be increased.
The front end part is working correctly, it shows as per my requirement.
but no values are updated in the database.
<%=radio_button(:nominees, count, :onclick =>
@voting.increment!('vote_count') ) %> <%= response.nomination %>
i want to store the selected values in nominees attribute and want to
increase the vote_count by selecting the option.
any help or advice reg this would be very helpful.
Hi,
Am creating a survey, in which am getting the questions from question
table and answers from answers table.
In the survey table am displaying the questions with the answers as
multiple choice using radio buttons.
Also while selcting the option the vote_count should be increased.
The front end part is working correctly, it shows as per my requirement.
but no values are updated in the database.
<%=radio_button(:nominees, count, :onclick =>
@voting.increment!('vote_count') ) %> <%= response.nomination %>
i want to store the selected values in nominees attribute and want to
increase the vote_count by selecting the option.
any help or advice reg this would be very helpful.
Keep a default value in the answer table for this particular field
instead of keeping it NULL
Thanks for the quick reply,
Am getting the radio button options from answers table. also its a group
of radio buttons.
so the count means for the radio_button id. if i change the count as
follows