I am currently working on a Rails 5.1 application that has two different User roles: "Admin" and "Customer". (I am storing the roles in a column named "role" #string on the User's table).
I am looking for the most efficient way to render different views based on the User Role. e.g.
If a user with the user.role = "Customer" logs in, I would like to render customer#index
If a user with the user.role = "Admin" logs in, I would like to render admin#index
Right now the route root is "admin#index". Is there a way to change the root route based on the role of the current user?
Any tips for the most efficient way of rendering different views based on user role will be appreciated! Thank you so much!