當需要驗證密碼時提供了 authenticate 的方法來做解密的動作。例如: user.authenticate('password'). 這邊在使用 has_secure_password 時要注意使用的Rails版本。
確定! 回上一頁