使用 TeacherID 登录设计教师模型,使用电子邮件登录学生模型

login devise teacher model using TeacherID while student model using email

是否可以允许一个设计模型根据用户名或其他一些唯一 ID 登录,而另一个使用默认设计电子邮件身份验证过程。

是的,这是可能的。您可以使用 multiple Devise User models for each role and use custom authentication methods. There is even a gem for creating custom Devise authentication strategies - DeviseCustomAuthenticatable.