我正在對user_mailer.rb文件進行更改,但無法獲取更新。每次更改後,我都重新啓動了服務器,但是我得到的錯誤仍然顯示我的代碼中不再存在的舊路徑方法。當我搜索舊路徑方法的代碼時,我無法在任何地方找到它,但返回的錯誤仍然顯示導致錯誤的舊路徑方法。user_mailer.rb中未更改的更改
這裏是user_mailer.rb新的代碼...
def invite_email(user, site_url)
@user = user
@url = "#{site_url}#{new_user_password_path}?invite_code=#{@user.user_invite.code}"
mail(:to => user.email, :subject => "#{@user.get_schools.map(&:name).join(', ')} - Welcome!", :from => "[email protected]")
end
這生成的URL,用戶從他們的電子郵件點擊它們引導到一個頁面,在這裏,他們可以爲自己的帳戶密碼( new_user_password_path)。舊路徑是「new_password_path」,這是給我一個錯誤的路徑。它是無處在的代碼,它不再是一個途徑,但我仍然得到一個錯誤,指出:
undefined local variable or method `new_password_path' for #<UserMailer:0x007fcbbcd19b58>
確保你運行正確的應用程序。 –
我正在運行正確的應用程序。並澄清,我已經重新啓動服務器後每次更新... –