I want to access usr_additional_users_attributes in the following params? how can i do that ?
params.require(:usr_contact).permit(:first_name, :last_name, :dob, :gender,
:mobile, :email, :password,
:password_confirmation,
:image,
usr_contact_vendors_attributes:
[:id, usr_vendor_property_attributes:
[:shop_name, :specified_area, :mobile, :website,
usr_vendor_branches_attributes:
[:address_line1, :address_line2, :city ,:zip_code ],
usr_additional_users_attributes:[:id,:email,:role, :_destroy]]] )
end
I want to get it like this in my controller and put emails to an array. this one showing an error
params[:usr_contact][:usr_contact_vendors_attributes][:usr_vendor_property_attributes][:usr_additional_users_attributes].values.each do |item|
@emailSet << item[:email]
end
undefined method `[]' for nil:NilClass
any suggestions ?