Skip to content

Instantly share code, notes, and snippets.

@andreapavoni
Forked from kazpsp/passwords_controller.rb
Last active December 15, 2015 10:29
Show Gist options
  • Save andreapavoni/5245821 to your computer and use it in GitHub Desktop.
Save andreapavoni/5245821 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