I would go with a TenantsController and a LandordsController and create scopes for landlords and tenants in the user model.
Aug 25, 2019
1
Level 1
Best way to manage users divided by roles
Hello, I have some doubt. I'm creating system for rent flats and actors in system are users with two roles (tenants, and landlords). In database I contained all users in one "users" table because their are very similar. But on controller or views level I supose that should be devided ... maybe use dedicated controllers? maybe dedicated methods in the same controller? and what about views ? better way is using "if else" statments to dynamic modyfing common view or mayby better way is create separated views for each role ?
What is your approach ?
thank you
Please or to participate in this conversation.