Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8670829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:48:00+00:00 2026-06-12T18:48:00+00:00

I am trying to add password reset functionality to my rails app using action

  • 0

I am trying to add password reset functionality to my rails app using action mailer. Everything seems to be working fine except that the generated link to reset the password is incorrect.

Here are the files:

File user_mailer.rb:

class UserMailer < ActionMailer::Base
  default from: "from@example.com"
  def password_reset(user)
    @user = user #make the user available in mailer template
    mail :to => user.email, :subject => "Password Reset"
  end
end

File password_reset.text.erb contains the following link:

<%= edit_password_resets_url(@user.password_reset_token) %>

I can see the user variable is passed properly as I get the email and token values. However, the URL generated in the mailer looks like the following:

http://localhost:3000/password_reset/edit.jo_jYhkjsdjskjdskYHJSDA

However, the expected value is like

http://localhost:3000/password_resets/jo_jYhkjsdjskjdskYHJSDA/edit

Have the following in routes.rb

resource :password_resets

Also, rake routes shows the following:

edit_password_resets GET /password_resets(.:format) password_resets#edit

What could be going wrong?

Note: I am following Ryan bates’ rails casts #274

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:48:01+00:00Added an answer on June 12, 2026 at 6:48 pm

    This seems like config/routes.rb contains resource :password_resets instead of resources :password_resets. As a singular resource, this would add an edit_password_resets route to /password_resets/edit(.:format). Passing a value into edit_password_resets_url would map to edit.<value>, consistent with the symptom you describe.

    Changing this to resources :password_resets should fix the issue. It will also rename the route to edit_password_reset — singular because it applies to a member, rather than plural which would apply to the collection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to add a blank sample app for a rails tutorial to GitHub, but
I'm new to Rails and I'm trying to create an app using devise for
Greetings! I'm trying to add simple mail functionality to a little web app and
I'm trying to add user/password to my working cruisecontrol instance but it doesn't have
Trying to add email notification to my app in the cleanest way possible. When
Trying to add a class object into a List using reflection, but when invoking
I'm trying to implement a question and answer password reset page, but this line:
I am trying to implement a password reset page. After the password is reset
Using MS Visual C++ and Boost asio, I'm trying to add the ability to
I have developed simple website using Tomcat and Java. Now I'm trying to add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.