Nested Radio Button Inside Checkbox

I've come to write a form, where inside each checkbox, there're two radio buttons associated.
HTML code looks like this:

<div>
  <input checked="checked" id="contact_id_" name="contact_id[]" type="checkbox" value="15098" />
  Brant Runolfsson
  
  <div class="address">
    <div class="not_enriched">
      <input checked="checked" class="address-radio-button" id="enriched_15098_false" name="enriched[15098]" type="radio" value="false" />  88325 Kutch Trafficway, West Keshawn, Colorado, 68914
    </div>
    <div class="enriched">
      <input class="address-radio-button" id="enriched_15098_true" name="enriched[15098]" type="radio" value="true" />  123 atlanta rd, atlanta, GA, 30303
    </div>
  
  </div>

  <input checked="checked" id="contact_id_" name="contact_id[]" type="checkbox" value="15099" />
  Mr. Ona Heathcote
  
  <div class="address">
    <div class="not_enriched">
      <input checked="checked" class="address-radio-button" id="enriched_15099_false" name="enriched[15099]" type="radio" value="false" />  30579 Adriel Loaf, South Abdulton, Montana, 36072-4890
    </div>
    <div class="enriched">
      <input class="address-radio-button" id="enriched_15099_true" name="enriched[15099]" type="radio" value="true" />  789 buckhead rd, atlanta, GA, 30303
    </div>
  </div>
</div>

The actual page shows:

In Rails view page:

<% @contacts.each do |contact| %> 
  <div>
    <%= check_box_tag("contact_id[]", contact.id, :checked=>true) %>
    <%= contact.first_name %>
    <div class="address">
      <div class="not_enriched">
        <%=radio_button_tag "#{contact.id}", false, true, class: "address-radio-button" %>  <%=contact.address%>
      </div>
      <div class="enriched">
        <%=radio_button_tag "#{contact.id}", true, false, class: "address-radio-button" %>  <%=contact.enriched_address%>
      </div>
    </div>
<% end %>

Here, contact_id is passed as the key to a set of actual contact.id from checkbox. For radio button, we have contact.id as each key, which has true or false as its value. Once the form is submitted, params looks like this:

Parameters: {"utf8"=>"✓", "authenticity_token"=>"8oaxxUgY6pU2Ocz/wegQodXBz/I=", "contact_id"=>["15098", "15099", "15100", "15101"], "15098"=>"true", "15099"=>"true", "15100"=>"false", "15101"=>"false"}

We do get all the values we need for the form. But the value passed in via radio button really isn't the best. When the number of contact increases, there'll be tons of hashes to be evaluated.

Ideally I'd like to have params with contact_id value as an array of hash.
"contact_id" => ["15098" => true, "15099" => false...] It represents what we try to accomplish here the best. In search of making this happen, I found an alternative. If I use a prefixed array, i.e. value for the radio button name field, then I should be able to reference that value via params['value']

So I tried this:

<% @contacts.each do |contact| %> 
  <div>
    <%= check_box_tag("contact_id[]", contact.id, :checked=>true) %>
    <%= contact.first_name %>
    <div class="address">
      <div class="not_enriched">
        <%=radio_button_tag "enriched[#{contact.id}]", false, true, class: "address-radio-button" %>  <%=contact.address%>
      </div>
      <div class="enriched">
        <%=radio_button_tag "enriched[#{contact.id}]", true, false, class: "address-radio-button" %>  <%=contact.enriched_address%>
      </div>
    </div>
<% end %>

Now I get params as:

Parameters: {"utf8"=>"✓", "authenticity_token"=>"oaxxUgY6pU2Ocz/wegQodXBz/I=", "contact_id"=>["15098", "15099", "15100", "15101"], "enriched"=>{"15098"=>"true", "15099"=>"true", "15100"=>"false", "15101"=>"false"}}

I can reference the values selected via radio button by params[:enriched]! It's not the best solution yet, but definitely a big improvement.