How to create different user roles in Rails3 using Devise?

I am developing a Rails 3 application that has two types of users: Teacher and Company. Teacher has many different areas that are characteristic of being a teacher, for example, experience and hourly pay. The company also has many companies. On the first page, the user (regardless of type) must log in by entering the username and password.

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

Thank!

+3
source share

Source: https://habr.com/ru/post/1781763/


All Articles