Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##model
- def self.passwords_combine(password1,password2)
- unless (password1 == password2)
- return [nil, "Password's don't match"]
- end
- @hashed_password = hash_password(password1)
- return [@hashed_password, nil]
- end
- ##controller
- @user.password, message = @user.passwords_combine(@user.password1, @user.password2)
- ##error
- undefined method `password1' for #<User:0x23860a0>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement