From 5c2ac3e02fed0990f49b611275da5bfd56099c10 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Mon, 27 Jun 2016 15:47:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E6=88=90=E5=91=98=E8=B7=A8=E5=9F=9F=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/org_member_controller.rb | 4 ++++ app/views/org_member/deleteOrgMember.js.erb | 3 +++ app/views/organizations/_org_member_list.html.erb | 6 ++++-- config/routes.rb | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 app/views/org_member/deleteOrgMember.js.erb diff --git a/app/controllers/org_member_controller.rb b/app/controllers/org_member_controller.rb index 642a100c3..2eaa790cd 100644 --- a/app/controllers/org_member_controller.rb +++ b/app/controllers/org_member_controller.rb @@ -54,4 +54,8 @@ class OrgMemberController < ApplicationController def index end + + def deleteOrgMember + destroy + end end diff --git a/app/views/org_member/deleteOrgMember.js.erb b/app/views/org_member/deleteOrgMember.js.erb new file mode 100644 index 000000000..d87e62c17 --- /dev/null +++ b/app/views/org_member/deleteOrgMember.js.erb @@ -0,0 +1,3 @@ +$("#org_members_count_id").html(""); +$("#org_members_count_id").html("<%= @org.org_members.count %>") +$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>'); \ No newline at end of file diff --git a/app/views/organizations/_org_member_list.html.erb b/app/views/organizations/_org_member_list.html.erb index 8e8a23b60..8af7986fc 100644 --- a/app/views/organizations/_org_member_list.html.erb +++ b/app/views/organizations/_org_member_list.html.erb @@ -1,6 +1,7 @@ <% members.each do |member|%>
diff --git a/config/routes.rb b/config/routes.rb index ec8fa2337..189c2671d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -116,6 +116,7 @@ RedmineApp::Application.routes.draw do end collection do get 'org_member_autocomplete' + get 'deleteOrgMember' end end