修改项目邀请用户失败时的提示

This commit is contained in:
sw 2015-03-13 17:46:09 +08:00
parent ca7c970094
commit e4e56e01b1
1 changed files with 6 additions and 2 deletions

View File

@ -99,7 +99,7 @@ class MembersController < ApplicationController
@project.members << members
# added by nie
@project.project_infos << project_info
@project.user_grades << user_grades
@project.user_grades << user_grades unless user_grades.first.user_id.nil?
# end
end
if members.present? && members.all? { |m| m.valid? }
@ -108,7 +108,11 @@ class MembersController < ApplicationController
end
end
if params[:flag]
flash[:notice] = l(:label_invite_success)
unless members.present? && members.all? {|m| m.valid? }
flash[:error] = members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ')
else
flash[:notice] = l(:label_invite_success)
end
respond_to do |format|
format.html { redirect_to invite_members_project_url(@project) }
end