Note that there are some explanatory texts on larger screens.

plurals
  1. PODevise: change password
    text
    copied!<p>I've been stuck on this for over 24hrs trying to follow other solutions posted here, but I can't get this to work. I'm new to Rails and need help!</p> <p>I want to get my /users/edit page working so that I can simply change a users password. Originally, I wanted to do it without current_password but I don't mind leaving it in there as long as I can get the password changing and updating. </p> <p>Here's what I did:</p> <p>I followed the example in the <a href="https://github.com/plataformatec/devise/wiki/How-To%3a-Allow-users-to-edit-their-account-without-providing-a-password" rel="nofollow">Devise Wiki</a> and inserted it into my Users controller which I specified to inherit from Devise::RegistrationsController</p> <pre><code>class UsersController &lt; Devise::RegistrationsController ... end </code></pre> <p>I changed my routes:</p> <pre><code>devise_for :users, :controllers =&gt; { :registrations =&gt; 'users' } do match '/users' =&gt; 'users#index' end </code></pre> <p>And here's my model: </p> <pre><code>class User &lt; ActiveRecord::Base devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable attr_accessor :password, :password_confirmation, :current_password attr_accessible :email, :password, :password_confirmation, :current_password, :remember_me, :full_name, :coach, :bio validates :full_name, presence: true end </code></pre> <p>I was assuming the UsersController I created would override the Registrations controller and that I would be able to change/update password. It works to the extent the redirect to root_path happens (which is only meant to happen after updating without current password) but the new password is not saved (I checked the logs and there was no SQL to show it was saved)...</p> <p>Any ideas?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload