Last active
August 29, 2015 14:19
-
-
Save chrisyeung1121/4853b1c0dc0e64147970 to your computer and use it in GitHub Desktop.
8_ruby_select
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
def sign_up_params | |
params.require(:user).permit(:email,:password) | |
end | |
# If user input :email => '[email protected]', :password=> nil | |
puts sign_up_params | |
# $> {"email"=>"[email protected]", "password"=>""} | |
puts sign_up_params.select{|k,v| v.present?} | |
# $> {"email"=>"[email protected]"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment