In a Rails 3 application, I have 2 logical entities - User and Company. I would like to have two different forms for registration (for users and for companies). It will also be great to have one login form for them.
Now I have a customized Devise + Cancan model for a user with two roles (user, company), so I now have "/ users / sign_in" and "/ users / sign_up".
I would like to have the following URLs in my application:
/login /users/signup /companies/signup
Another question is how to organize the relationship between the user and the company, if the company inherited from the user or I use aggregation - User has_one Company? I prefer the second option and plan the user user.company with cancan user role = "company".
Please help me with this. Thanks.
source share