I have a survey taking page with a set of questions. Each question has
five radio buttons. After answering the questions user clicks submit.
Then based on the selection the values must be updated in the table
Each row in the results table represents a unique radio button.
the code is here
All the radio buttons each having unique result id are being passes in
But I want only the selected ones.
I am new to ruby on rails…can you please help me out?
<% if @questions.size>0 %>
<% form_tag :action => ‘results_update’, :method => :put do %>
<% for @q in @questions %>
<% @results = Results.where(:Questions_id => @q.id) %>
<% for r in @results %>
<%= radio_button_tag @q.id, ‘results.ids’,r.id%>
<% end %>
<%= submit_tag "Submit" %><% end %> <% else%>
<%= “There are no Questions in this survey”%>