diff --git a/app/controllers/admin/member_infos_controller.rb b/app/controllers/admin/member_infos_controller.rb index cc70ac5..9b98b52 100644 --- a/app/controllers/admin/member_infos_controller.rb +++ b/app/controllers/admin/member_infos_controller.rb @@ -33,6 +33,7 @@ class Admin::MemberInfosController < OrbitMemberController field_status = a.last[:id].present? @attribute_field = MemberProfileField.add_attribute_field(@attribute, a.last, a.last[:id], field_status) end + @attribute.member_profile_fields.each{|t| t.destroy if t["to_delete"] == true} respond_to do |format| format.js { render 'admin/member_infos/add_attribute_field' } end diff --git a/app/controllers/admin/roles_controller.rb b/app/controllers/admin/roles_controller.rb index a7bb2a6..e552757 100644 --- a/app/controllers/admin/roles_controller.rb +++ b/app/controllers/admin/roles_controller.rb @@ -39,6 +39,7 @@ class Admin::RolesController < OrbitMemberController @attribute = @role end flash.now[:notice] = "Updated Fields" + @role.attribute_fields.each{|t| t.destroy if t["to_delete"] == true} respond_to do |format| format.js { render 'add_attribute_field' } end