I have a form for an ordered_special. An ordered_special has many ordered_special_foods. Basically, within a loop in the form I am doing something like the following:
<% special.foods.each do |food| -%> <% fields_for OrderedSpecialFood.new do |os| %> <% food.food_types.each do |food_type| -%> <div><%= os.radio_button :food_type, food_type.id %> <%= food_type.name %></div> <% end -%> <% end -%> <% end -%>
So, I am trying to add OrderedSpecialFoods to the OrderedSpecial. The problem is that I want the radio button to distinguish that we are handling a different OrderedSpecialFood for each occurrence of the outer loop. Right now, all of the radio buttons belong to the same group. I understand why that is, but I want to distinguish between multiple new OrderedSpecialFoods and I am not sure how to do that exactly. Any help is appreciated.