Created
August 12, 2012 03:22
-
-
Save guilleiguaran/3329409 to your computer and use it in GitHub Desktop.
StrongParameters with Devise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/routes.rb | |
devise_for :users, :controllers => {:registrations => "users/registrations", :passwords => "users/passwords"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need also
:current_password
for theRegistrationsController