Im trying to figure out how to retrieve the selected radio button from a radio_button_tag.
I cant seem to obtain the selected member, and feed that into the DB.
I have 3 buttons which are defined in their own table RESULTS: (id, type) 1, Pass 2, Fail 3, N/A
RESULTS belongs to OUTCOMES which basically is linked on result_id
in my view: <% @results.each do |r| %> <%= "#{r.resulttype}" -%> %= radio_button_tag :result_id, :result, true %></td> <% end %>
which displays the buttons fine! not sure if its correct though
on clicking the save button <% form_tag ({:action => 'verify', :controller => 'outcome', :id => @testcase, :id1 => @testrun, :id2 => :result_id}) do %>
i would like the result id of the selected button to be passed as :id2
???
at the moment, i just seem to be generating long numbers when passing across.
{"id1"=>"31", "result_id"=>"2165464", "id2"=>"result_id", "commit"=>"Save", "id"=>"1"}
i noticed the form seems to be grabbing result_id as a value, is there any way i can override this so it uses result_id as :id2 in the url?
thanks in advance!