Skip to content

Instantly share code, notes, and snippets.

@PabloVallejo
Last active August 29, 2015 14:10
Show Gist options
  • Save PabloVallejo/b8062b8699f5afcd33e3 to your computer and use it in GitHub Desktop.
Save PabloVallejo/b8062b8699f5afcd33e3 to your computer and use it in GitHub Desktop.
Configuring permitted parameters in devisee.
#
# Configure permitted parameters for a devise action.
# This can be done in several ways on which this two are
# the most used.
#
def configure_permitted_parameters
# Usign a `do` block.
devise_parameter_sanitizer.for(:sign_up) do |u|
u.permit(:name, :heard_how,
:email, :password, :password_confirmation)
end
# Appending parameter name to array.
devise_parameter_sanitizer.for(:account_update) << :my_attribute
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment