암호를 재설정하기 위해 사용자에게 전자 메일을 보내려 할 때 실행 시간 초과 오류가 계속 발생합니다. 다른 메일러 기능이 작동하므로 구성 설정이 정확하다는 것을 알고 있습니다. 헤더 읽기 : 여기 ActionMailer 실행 제한 시간
가 password_resets_controller이다 "암호 resetsController 번호에서 시간 초과 : 오류 생성"여기def create
@user = User.find_by_email(params[:email])
if @user
User.deliver_password_reset_instructions(@user.id)
flash[:notice] = "Instructions to reset your password have been emailed to you. " +
"Please check your email."
redirect_to '/'
else
flash[:notice] = "No user was found with that email address"
render :action => :new
end
end
여기, 마지막으로
def self.deliver_password_reset_instructions(user_id)
user = User.find(user_id)
user.reset_perishable_token!
Emailer.deliver_password_reset_instructions(user)
end
User.rb
의 내부의 방법입니다 emailer.rb의 실제 메소드입니다.default_url_options[:host] = "http://0.0.0.0:3000" #development
def password_reset_instructions(user)
@subject = "Application Password Reset"
@from = '[email protected]'
@recipients = user.email
@sent_on = Time.now
@body["edit_password_reset_url"] = edit_password_reset_url(user.perishable_token)
@headers["X-SMTPAPI"] = "{\"category\" : \"Password Recovery\"}"#send grid category header
end
왜 "비밀번호"가 n 시간 초과 :: 오류를 일으키는 오류 메시지