Controller for Devise

I have Devise and CanCan working well with my app.

I have 2 models: Account (Company Name) and User(users that login).
Account has many Users.
User belongs to Account.

Check out these 2 iterations:

  1. So the first time someone creates a user (someone subscribes, from a
    SUBSCRIBE form), it’s supposed to create an account too and insert the
    newly created account id into users’ account_id column.

  2. Then the first user can add more users and that same account id can
    be used. (from an ADD USER form)

Number 2 I already got it working. I create the Account using the
console, and the user can login and add users with the same account id.
But I can’t do Number 1!!!

I’m trying to look for the registration_controller of devise but can’t
find it. I’m thinking about checking the route to find out if it comes
from new_user_registration then create account and add account_id to
user. If it comes from new_user, then just use the existing account_id.

Suggestions on how to go about this problem?

Ok I have been researching. It seems like Devise doesn’t use the
users_controller.rb when creating new users, it uses a
registrations_controller instead.

So it all boils down to finding the registrations controller. Anybody
can tell me where can I find it?

Well after a lot of researching I ended up creating a
registration_controller.rb file like a lot of sites recommend. At first
I thought creating a registration controller was going to make default
registration actions stop working so I could create all actions from
scratch but it seems it’s not that way.

Just wanted to add it as a note in case someone was running into the
same doubt I had.