<%= f.fields_for :benefit_descs do |plan_benefit_fields| %>
<%= plan_benefit_fields.text_field :plan_id, class: "hidden", value: "descriptions" %>
<% @form.benefits_template.each do |bene| %>
<%= plan_benefit_fields.text_field "benefit_#{bene.sequence}", label: { text: "Benefit Description #{bene.sequence}" }, value: "#{bene.benefit_desc}", class: "w-full" %>
<% end %>
<% end %>
<% @form.plans.each_with_index do |plan, i| %>
rounded-bl-lg">
-ml-[6px] z-2 w-full">
<%= "Plan #{i + 1}" %>
<%= f.fields_for :plans, index: i do |plan_fields| %>
<%= plan_fields.text_field :plan_id, label: { text: "Plan Id" }, class: "w-full", data: { add_plan_target: "plan" } %>
<%= f.select :template_id, options_from_collection_for_select(@form.plan_templates, :id, :title), { prompt: "Select Plan Template" }, { data: { action: "benefits-template-picker#fetchData" }} %>
<% @form.benefits_template.each do |bene| %>
<%= plan_fields.text_field "benefit_#{bene.sequence}", label: { text: "Benefit Value #{bene.sequence}" }, data: { benefits_template_picker_target: "benefit", sequence: "#{bene.sequence}"}, class: "w-full" %>
<% end %>
<% end %>
<% end %>
<%= button_tag "Add a Plan", class: "cursor-pointer text-2xl font-bold py-2 pr-6 mt-10 w-[calc(24%-1rem)] w-1/4 min-h-[940px] text-[#E0E0E0] rounded-lg font-medium border border-[#E0E0E0] bg-[#173057] hover:bg-transparent hover:shadow-[0_0_10px_3px_#93c5fd] transition-colors duration-150", data: { action: "add-plan#add", add_plan_target: "button" } %>
<%= "Plan NEW_PLAN" %>
<%= f.fields_for :plans, index: 'NEW_RECORD' do |plan_fields| %>
<%= plan_fields.text_field :plan_id, label: { text: "Plan Id" }, class: "w-full", data: { add_plan_target: "plan" } %>
<%= f.select :template_id, options_from_collection_for_select(@form.plan_templates, :id, :title), { prompt: "Select Plan Template" }, { data: { action: "benefits-template-picker#fetchData" }} %>
<% @form.benefits_template.each do |bene| %>
<%= plan_fields.text_field "benefit_#{bene.sequence}", label: { text: "Benefit Value #{bene.sequence}" }, data: { benefits_template_picker_target: "benefit", sequence: "#{bene.sequence}"}, class: "w-full" %>
<% end %>
<% end %>