Rails model structure for users

后端 未结 6 756
长情又很酷
长情又很酷 2021-02-04 19:09

I\'m new to rails, and I\'m working on my second rails app.

The app will have different roles for users, but some users will have multiple roles.

Every user of t

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-04 19:39

    You can have two models User and Role. And Role belongs to User.

    Specify role of users (like admin, moderator) in Role model.

提交回复
热议问题