Brian Jeffrey Gross
Brian Jeffrey Gross

Reputation: 356

Changes in user_mailer.rb not taking

I am making changes in my user_mailer.rb file, but I cannot get the updates to take. I have restarted my server after each change, but the error I am getting is still showing an old path method in my code that no longer exists. When I search the code for the old path method I cannot find it anywhere, but the error that is returned still shows the old path method causing the error.

Here is the new code in 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

This generates a URL for the user to click from their email directing them to a page where they can set a password for their account (new_user_password_path). The old path was "new_password_path", and this is the path that is giving me an error. It is nowhere in the code and it is no longer a route, but I am still getting an error that says:

undefined local variable or method `new_password_path' for #<UserMailer:0x007fcbbcd19b58>

Upvotes: 0

Views: 64

Answers (1)

Tetsuwan
Tetsuwan

Reputation: 36

Try to restarting your Delayed Job, because the save old version ruby code

Upvotes: 2

Related Questions