修改BUG

This commit is contained in:
nwb 2014-05-22 13:40:41 +08:00
parent f51873d98b
commit 4f9625b265
2 changed files with 6 additions and 1 deletions

View File

@ -47,6 +47,8 @@ class MembersController < ApplicationController
def create
if params[:refusal_button]
members = []
applied_members = true
if params[:membership]
if params[:membership][:user_ids]
attrs = params[:membership].dup
@ -57,6 +59,7 @@ class MembersController < ApplicationController
end
end
else
applied_members = false
members = []
project_info = []
user_grades = []
@ -94,7 +97,7 @@ class MembersController < ApplicationController
respond_to do |format|
format.html { redirect_to_settings_in_projects }
format.js { @members = members;@applied_members = members; }
format.js { @members = members;@applied_members = applied_members; }
format.api {
@member = members.first
if @member.valid?

View File

@ -1,6 +1,7 @@
$('#tab-content-members').html('<%= escape_javascript(render :partial => 'projects/settings/members') %>');
hideOnLoad();
<%if !@applied_members%>
<% if @members.present? && @members.all? {|m| m.valid? } %>
<% @members.each do |member| %>
$("#member-<%= member.id %>").effect("highlight");
@ -9,3 +10,4 @@ hideOnLoad();
<% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ') %>
alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => errors))) %>');
<% end %>
<%end%>