<% @id_card_template_benefits.each do |bene| %>
<%= f.fields_for :benefit_descs do |bd_fields| %>
<%= bd_fields.text_field "#{bene.sequence}", label: { text: "Benefit Description #{bene.sequence}" }, value: "#{bene.benefit_desc}" %>
<% end %>
<% end %>
<% @form.number_of_plans.to_i.times do |i| %>
<% border_colors = ['border-atmosphere', 'border-copper', 'border-bluemana'] %>
<% text_colors = ['text-atmosphere', 'text-copper', 'text-bluemana'] %>
<%= "Plan #{i + 1}" %>
<%= f.fields_for :plans do |plan_fields| %>
<%= plan_fields.text_field :plan_id, label: { text: "Plan Id" }, class: "w-full" %>
<%= f.select :template_id, options_from_collection_for_select(@id_card_templates, :id, :name), { prompt: "Select Existing Template (optional)", data: { action: "benefits-template-picker#fetchData" }} %>
<% @id_card_template_benefits.each do |bene| %>
<%= plan_fields.text_field "#{bene.sequence}", label: { text: "Benefit Value #{bene.sequence}" }, data: { benefits_template_picker_target: "benefit_#{bene.sequence}" }, class: "w-full" %>
<% end %>
<% end %>