0
votes

I'm trying to restrict Devise password resets for particular users. I found this thread which describes overriding PasswordsController:

Restrict Devise password recovery to only certain users

My problem is, I'm already overriding registrations with my own registrations controller:

devise_for :users, :controllers => { registrations: 'registrations' }

My registrations controller inherits from Devise::RegistrationsController, and according to the above thread my Password controller will need to inherit Devise::PasswordsController, and thus be a separate controller. How can I have multiple Devise controllers to facilitate these overrides?

1

1 Answers

2
votes

The line

:controllers => {registrations: 'registrations' } 

uses your custom registrations controller, so adding {passwords: 'passwords'} will use your custom passwords

The complete line should be

controller.devise_for :users, :controllers => { registrations: 'registrations', passwords: 'passwords'  }