Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# app/controllers/custom_devise/password_controller.rb
class CustomDevise::PasswordsController < Devise::PasswordsController
def resource_params
params.require(resource_name).permit(:email, :password, :password_confirmation)
end
private :resource_params
end
# app/controllers/custom_devise/registrations_controller.rb
class CustomDevise::RegistrationsController < Devise::RegistrationsController
def resource_params
params.require(resource_name).permit(:name, :email, :password, :password_confirmation)
end
private :resource_params
end
# config/routes.rb
devise_for :users, controllers: {
registrations: "custom_devise/registrations",
passwords: "custom_devise/passwords"
}
devise_for :admins, controllers: {
registrations: "custom_devise/registrations",
passwords: "custom_devise/passwords"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment