The selected radio button's value will be accessable in your controller
method via the name you've given your radio buttons. So in this case,
the 'do' method in your controller would probably look something like:
def do
if params[:exp] = '1' #remember that params come back as strings
do_something
elsif params[:exp] = '2'
do_something_else
else
handle_the_no_default_radio_button_case # if you want one to be checked, supply true as the third parameter
end
respond_to do |format|
format.js {
render :update do |page|
page.replace_html or some other reponse
end
}
end
end
put them both inside one <div id="whatever">...</div> and :submit =>
'whatever'. Assuming you name them group1 and group2, you'll access via
params[:group1] and params[:group2]