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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:52:25+00:00 2026-05-31T21:52:25+00:00

I am using rails 3 with gem devise.Devise has built in method for change

  • 0

I am using rails 3 with gem devise.Devise has built in method for change password.But i want

that admin can reset password of any user and how i can do it please help..

  • 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-05-31T21:52:26+00:00Added an answer on May 31, 2026 at 9:52 pm

    You can define custom method and also define routes for it

     <%= form_for(:user, :url => {:controller => '/administrator', :action =>                  'change_password',:id => @user.id}, :html => {:id => 'admin_update_form',:method => :put}) do |f| %>
    
    <div class="change-pass">
      <h2>Change Passwords</h2>
    
      <div class="pass-detail">
        <div class="username-btn">
          <label>Passwords</label>
          <%= f.password_field :password, :class=> 'fields' %>
        </div>
        <div class="username-btn" style="margin-bottom:40px;">
          <label>Confirm Passwords</label>
          <%= f.password_field :password_confirmation, :class=> 'fields' %>
        </div>
        <%=hidden_field_tag 'user_ids',:id => 'user_ids'  %>
        <div class="username-btn_button">
          <%= f.submit 'change password', :id => 'password_btn' ,:class => 'reg-findjob'%>
        </div>
      </div>
    </div>
    

    In controller code

    def change_password
       @user = User.find(params[:id])
       if @user.update_attributes(:password => params[:user][:password],    :password_confirmation => params[:user][:password_confirmation])
         flash[:notice] = 'Password was changed successfully.'
         render :text => 'ok'
       else
        flash[:error]=[]
        @user.errors.full_messages.each do |error|
          flash[:error] << error
        end       
    end
    

    In controller find user and update its password attribute.I am sending user id with form

    whose password is to changed or you can do it according your requirement.

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

Sidebar

Related Questions

Hi I am using the devise gem for rails for app. My question is
I need to know how configure the gem devise,Im using ruby 1.9.2, rails 3.1.3,
Im using the Rails Roo Gem. I want to be able to get a
Note: Using Rails 3.1 and current delayed_job gem. I have a User model that
if i am using the devise gem with rails, how do i make the
I want to suspend users in my Rails application. I am using Devise. I
I have a rails app that is using Devise, with a User model, no
I'm using Rails with the Devise gem . If I try to sign-in with
In attempting to upgrade to Bootstrap 2 (using twitter-bootstrap-rails gem), it seems that page-specific
We've got a Rails application just upgraded to Rails3 using Devise's Rails3 gem for

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.