<% if request.env["PATH_INFO"] == "/admin/quotations/new" || "/admin/quotations/edit"%>
<%= f.fields_for field.association_name do |nested_form| %> <%= render( partial: "fields/nested_has_many/fields", locals: { f: nested_form, field: field, }, ) %> <% end %>
<% if field.attribute.to_s == "line_items"%> <%= link_to_add_association( ('').html_safe, f, field.association_name, class: "button toto button_add_associated_#{field.associated_class_name}", # class: "button toto button_add_associated_#{field.associated_class_name}", # # id usefull for the JS inside New quotation # id: "button_add_associated_#{field.associated_class_name}", partial: "fields/nested_has_many/fields", render_options: { locals: { field: field } }, ) %> <% end %> <% if field.attribute.to_s == "working_zones"%> <%= link_to_add_association( ('').html_safe, f, field.association_name, class: "button toto button_add_associated_#{field.associated_class_name}", # class: "button toto button_add_associated_#{field.associated_class_name}", # # id usefull for the JS inside New quotation # id: "button_add_associated_#{field.associated_class_name}", partial: "fields/nested_has_many/fields", render_options: { locals: { field: field } }, ) %> <% end %>
<% else %>
<%= f.label field.attribute %> <%= f.fields_for field.association_name do |nested_form| %> <%= render( partial: "fields/nested_has_many/fields", locals: { f: nested_form, field: field, }, ) %> <% end %>
<%= link_to_add_association( I18n.t("administrate.fields.nested_has_many.add", resource: field.associated_class_name.titleize), f, field.association_name, class: 'button', partial: "fields/nested_has_many/fields", render_options: { locals: { field: field } }, ) %>
<% end %>