views:

20

answers:

0

I have a bunch of forms listed in Rails like such

<% parent.children.some_named_scope.each do |child| %>
  <% form_for :parent, parent do |f| %>
      <% child.possible_values_for_column_to_set.each do |value| %>
        <% f.fields_for :children, child, :child_index => child.id.to_s do |child_form| %>
          <%= child_form.label :column_to_set, value.to_s.titleize, :value => value %>
          <%= child_form.radio_button, :column_to_set, value, :type => 'radio' %>
        <% end %>
      <% end %>
    <%= f.submit "Submit", :disabled => true %>
  <% end %>
<% end %>

How do I enable the closest submit button when a radio button is clicked?