Skip to content

Instantly share code, notes, and snippets.

@nkpgardose
Created February 18, 2016 05:19
Show Gist options
  • Save nkpgardose/0d4530a9920df4ea23d4 to your computer and use it in GitHub Desktop.
Save nkpgardose/0d4530a9920df4ea23d4 to your computer and use it in GitHub Desktop.
def user_params
other_phones = params.require(:user).fetch(:other_phones, nil).try(:permit!)
params[:user].delete(:other_phones)
params.require(:user).
permit(:email, :password, :password_confirmation, ...).
merge(other_phones: other_phones)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment