开发者

How to create different roles for users in Rails3 using Devise?

开发者 https://www.devze.com 2023-01-31 17:33 出处:网络
I\'m developing a Rails 3 application that has two user types: Teacher and Company. Teacher has many different fields that are specific to being a teacher, such as experience and hourly pay.

I'm developing a Rails 3 application that has two user types: Teacher and Company. Teacher has many different fields that are specific to being a teacher, such as experience and hourly pay. Company also has many company-specific fields. From the front page, a user (regardle开发者_开发技巧ss of type) should be able to log in by typing in a username and password.

Here's my question: What models should I have in my application? How do I connect them so that usernames still have to be unique, but so that I have a separate model for Teacher and for Company?

Thanks!


here is your answer http://www.tonyamoyal.com/2010/07/28/rails-authentication-with-devise-and-cancan-customizing-devise-controllers/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号