Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mediasota/5667292 to your computer and use it in GitHub Desktop.
Save mediasota/5667292 to your computer and use it in GitHub Desktop.
# 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