Instantly share code, notes, and snippets.

Embed
What would you like to do?
StrongParameters with Devise
# app/controllers/users/password_controller.rb
class Users::PasswordsController < Devise::PasswordsController
def resource_params
params.require(:user).permit(:email, :password, :password_confirmation)
end
private :resource_params
end
# app/controllers/users/registrations_controller.rb
class Users::RegistrationsController < Devise::RegistrationsController
def resource_params
params.require(:user).permit(:name, :email, :password, :password_confirmation)
end
private :resource_params
end
# config/routes.rb
devise_for :users, :controllers => {:registrations => "users/registrations", :passwords => "users/passwords"}
@al

This comment has been minimized.

al commented Sep 23, 2012

You'll need to add :reset_password_token to the list in Users::PasswordsController.

@sekrett

This comment has been minimized.

sekrett commented Oct 31, 2012

You need also :current_password for the RegistrationsController

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment