谷歌: xl_chrome_plugin导致rails请求重复

 

今天在做一个 注册的功能, 用户注册成功后, 系统向用户邮箱发送激活链接的邮件

重新发送邮件的时候,谷歌浏览器竟然发送了两次~

 

 

在prompt_activate_email.html.erb页面中有一个重新发送激活邮件的功能

<a href = "/user/resend?xxx">

当点击重新发送链接后, 进入resend,发送邮件,成功后跳转到提醒用户激活邮箱页面

 

部分代码:

 

 #提示用户激活邮箱
  def prompt_activate_email
    render "/user/prompt_activate_email", :layout => "new"
  end


  #重新发送激活链接
  def resend
     send_reg_validate_email(params[:email])
     redirect_to user_prompt_activate_email_path
  end

 

测试firefox, ie都没有问题, chrome却给用户发送了两个邮件, debugger了一下,确实请求了两次resend

以为是其他js文件导致的, 在页面中去掉了所有的html标签及js, 只留下一个a链接, 重新发送还是请求了两次

..

 
谷歌: xl_chrome_plugin导致rails请求重复_第1张图片

去掉xl_chrome_plugin标签, 终于正常了!

 

 

 

 

你可能感兴趣的:(Rails,a)