Add checkbox to clear business_address form

This commit is contained in:
Nihal Mohammed
2021-08-10 15:54:47 +05:30
committed by Nihal M. Kelanthodika
parent 32d8ce78ef
commit 3cd5ed58c0
3 changed files with 8 additions and 2 deletions

View File

@@ -60,7 +60,7 @@ class Enterprise < ApplicationRecord
delegate :latitude, :longitude, :city, :state_name, to: :address
accepts_nested_attributes_for :address
accepts_nested_attributes_for :business_address
accepts_nested_attributes_for :business_address, allow_destroy: true
accepts_nested_attributes_for :producer_properties, allow_destroy: true,
reject_if: lambda { |pp|
pp[:property_name].blank?

View File

@@ -6,7 +6,7 @@ module PermittedAttributes
[
:company, :address1, :address2,
:city, :country_id, :state_id, :zipcode,
:phone
:phone, :_destroy
]
end
end

View File

@@ -39,3 +39,9 @@
= bf.label :phone, t(".legal_phone_number")
.eight.columns.omega
= bf.text_field :phone, { placeholder: t(".phone_placeholder") }
.row
.three.columns.alpha
= bf.label :clear
.eight.columns.omega
= bf.check_box :_destroy