<%#= form_with(model: @customer, local: true) do |form| %> <%= form_for @customer, :url => { action: :save_next_of_kin_details, appid: @loan_application.appid } do |form| %> <% if @customer.errors.any? %>

<%= pluralize(@customer.errors.count, "error") %> prohibited this customer from being saved:

<% end %> <% i = 0 %> <%= form.fields_for :next_of_kins do |builder| %>

Next of Kin Details <%= i+=1 %>

<%= builder.label :firstname %> <%= builder.text_field :firstname %>
<%= builder.label :lastname %> <%= builder.text_field :lastname %>
<%= builder.label :relation, "Relationship" %> <%= builder.text_field :relation %>
<%= builder.label :address_1, "Street Name" %> <%= builder.text_field :address_1 %>
<%= builder.label :address_2, "Location" %> <%= builder.text_field :address_2 %>
<%= builder.label :city, "City/Town" %> <%= builder.text_field :city %>
<%= builder.label :mobile_1, "Mobile Number" %> <%= builder.text_field :mobile_1 %>
<% end %>
<%= form.submit %>
<% end %>