I've been having an issue fully grasping how to separate my application by user role.
My goal is to have a user signup via one registration and to be rooted to a specific root along with specific layout with different devise account information.
Any user no matter the role will be able register by username email, password. But after registration will be required to enter additional account info if the role requires.
Example regular user just needs username password email.
Vip would need name address username password email.
So far I have my roles set up within my devise user model
ROLES w% [ regular vip1 vip]
I've set up a separate controller to redirect current user by role to a specific path.
def index
path = case current_user.role
when 'regular
edit_user_registration_path
else.... etc etc
I also overridden devise registration controller to include roles on sign up.
My issue is still finding a way to assign layouts by user role and require additional account information by role as well. And even though I've found a way to redirect a user by role. It would be much easier to find a way to redirect user after sign up to a specific page and root a user by role.
I've also looked through CanCanCan docs and understand the concept of limiting different features per user role for example one user having the ability to create a post and another not. Which is really valuable for the application I'm planning to build but is there anything that explains how to root and render different layouts per user.
Also I'm open to a different strategy that might help separate users by role but still has the convenience of one common login and signup. Last but not least I also plan to add one click sign on from sites like twitter and facebook, when dealing with user role would you expect an issue down the road?
Any ideas or advice would help. again I've read thoroughly on cancancan and devise I'm either totally missing something or completely confused.
Any help I would be the utmost grateful.