Last active
January 3, 2016 06:19
-
-
Save jkappers/8421824 to your computer and use it in GitHub Desktop.
Easily allow additional parameters for :sign_up, :invite, :accept_invite etc.
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
class ApplicationController < ActionController::Base | |
protect_from_forgery with: :exception | |
def devise_parameter_sanitizer | |
return super unless resource_class == User | |
Sanitizers::User.new(User, :user, params) | |
end | |
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
class Sanitizers::User < Devise::ParameterSanitizer | |
def attributes_for(key) | |
super + %i[first_name last_name] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment