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 8350753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:25:16+00:00 2026-06-09T08:25:16+00:00

In my ruby on rails project, I am using devise as the authentication plugin.

  • 0

In my ruby on rails project, I am using devise as the authentication plugin. Now I have added the change password functionality to the project and when submit the form, I’m getting an error No route matches "/users/update_password"

This is my update password code

  def update_password
    @user = User.find(current_user.id)
    if @user.update_attributes(params[:user])
      # Sign in the user by passing validation in case his password changed
      sign_in @user, :bypass => true
      redirect_to root_path
    else
      render "edit"
    end
  end

This is my route details

resources :users, :only => [] do
        collection do
            get 'current'
            get 'edit'
            post 'update_password'
        end
    end

and this is my edit form

<div id="loginForm">
    <div id="loginHeader"><h3>Change Password</h3></div>
    <div id="loginContent">
        <%= form_for(@user, :url => { :action => "update_password" }) do |f| %>
            <p><%= f.password_field :current_password, :class => "login_txt", :placeholder => "We need your current password to confirm your changes", :autocomplete => "off" %></p>
            <p><%= f.password_field :password, :class => "login_txt", :placeholder => "New password", :autocomplete => "off"  %></p>
            <p><%= f.password_field :password_confirmation, :class => "login_txt", :placeholder => "Confirm password", :autocomplete => "off" %></p>
            <p>
                <input id="user_submit" name="commit" type="submit" value="Update Password" class="login_btn" /> 
            </p>
        <% end %>
    </div>
</div>

Can anyone help me how to fix this issue

Thanks a lot

  • 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-09T08:25:19+00:00Added an answer on June 9, 2026 at 8:25 am

    In your routes.rb you define update_password as a POST action on the collection (/users/update_password), but in your form you are implicitly defining it as a PUT action when you pass @user to form_for, since @user already exists.

    I haven’t tested this, but I believe that changing your route on the collection from a POST to a PUT should fix this:

    resources :users, :only => [] do
      collection do
        get 'current'
        get 'edit'
        put 'update_password'
      end
    end
    

    See also: Rails 3.0.10, customer routes, post and form_for tag

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

Sidebar

Related Questions

I have been working on Ruby on rails project for a while now, when
Ive recently started using Ruby on Rails for a project of mine and have
I have a Ruby on Rails project, using Python + Scrapy to scrape the
I am using Haml in a Ruby on Rails project. I know you use
im working in a project writen in ruby on rails and im currently using
This is not a ruby/rails project deploy. I have the following situation and I
I am building a ruby on rails project. it is a portal. I have
Hello Ruby/Rails/Merb developers! Im currently working on a web project that will have a
I have a project in ruby on rails 3.1 like flickr, tumblr, pinterest...etc with
How to change your project name in ruby on rails ? while u create

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.