-
-
Save bluemont/e304e65e7e15d77d3cb9 to your computer and use it in GitHub Desktop.
Due to some recent changes in the `rails4` branch of Devise, I needed to update the code I borrowed from
https://gist.github.com/kazpsp/3350730. Here it is. Read more on the [Rails 4 Devise branch README](https://github.com/plataformatec/devise/tree/rails4#strong-parameters). If you want to see what options you can pass into `devise_parameter_sa…
This file contains hidden or 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
# controllers/users/registrations_controller.rb | |
class Users::RegistrationsController < Devise::RegistrationsController | |
before_filter :configure_permitted_parameters | |
protected | |
# my custom fields are :name, :heard_how | |
def configure_permitted_parameters | |
devise_parameter_sanitizer.for(:sign_up) do |u| | |
u.permit(:name, :heard_how, | |
:email, :password, :password_confirmation) | |
end | |
devise_parameter_sanitizer.for(:account_update) do |u| | |
u.permit(:name, | |
:email, :password, :password_confirmation, :current_password) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @Ruby-rocker, works good :)