Skip to main content
Ask A Question
You’re not receiving notifications from this thread.

How do i create another table when a user signs up?

Rails • Asked by Alan Reid

When a user signs up, i ask them for their company name so i can then associate that user with a company. How would i go about doing this? I am using devise, so somehow i will need to store the company name in the company table.

Please help :D

Hey Alan, check out this episode:

Basically what you can do is setup a form that assigns attributes to two models at the same time. This will let you create a user and their associated Company record in a single form. 👍

Cheers Chris, Let me check this out and get it working :D

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 31,353+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.