Obtaining a result from radio_button_tag

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!

radio_button_tag(name, value, checked = false, options = {})

Change the name to id2 if you want value to be returned in id2 when the form is submitted. What is the value of :result_id? It seems to be a class id value. Are you sure that is what you want to assign to that radio button (maybe you mistyped r.result_id ?)