修改邮箱邀请时,邮件为空时提示错误

This commit is contained in:
huang 2015-03-12 15:13:41 +08:00
parent 69eecf49d1
commit 0ba7ef0560
3 changed files with 12 additions and 4 deletions

View File

@ -334,8 +334,7 @@ class ProjectsController < ApplicationController
end
def send_mail_to_member
if !params[:mail].nil? && User.find_by_mail(params[:mail].to_s).nil?
if !params[:mail].blank? && User.find_by_mail(params[:mail].to_s).nil?
email = params[:mail]
Mailer.send_invite_in_project(email, @project, User.current).deliver
@is_zhuce =false

View File

@ -1,3 +1,12 @@
<script>
function ismail(mail) {
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(mail)) return true;
else {
alert('您的电子邮件格式不正确');
return false;}
}
</script>
<div class="project_r_h">
<h2 class="project_h2">邀请加入</h2>
</div>
@ -9,7 +18,7 @@
<div class="box_main">
<h3 class="box_h3">发送邮件邀请新用户</h3>
<p class="box_p">
输入好友邮箱地址Trustie帮您免费发送
输入好友邮箱地址Trustie会自动为该邮箱注册用户
</p>
<div id="is_registed">
<%= render :partial => 'regested', locals: { :isregisted => false} %>

View File

@ -181,7 +181,7 @@ zh:
notice_successful_create: 创建成功
notice_successful_update: 更新成功
notice_successful_delete: 删除成功
notice_registed_success: 该邮箱已被注册,请直接邀请注册用户
notice_registed_success: 您输入的邮箱为空或者该邮箱已被注册!
notice_failed_delete: 删除失败
notice_successful_connection: 连接成功
notice_successful_join: 加入成功