In a recent project, I used a form object template to create both a developer user and a company in one step. This includes going around the Devise RegistrationsController and creating your own RegistersController.
A related registration model is defined as a form object.
A great read of form objects (and the source for my work) is a CodeClimate blog post by Refactoring .
In general, I strongly prefer this approach using accepts_nested_attributes_for , although there may be even more possibilities. Let me know if you find it!
===
Edit: Added reference models and their associations for better understanding.
class User < ActiveRecord::Base
This structure in the model is modeled along with saucy , a gem from thoughtful. The source is not on Github AFAIK, but can extract it from a gem. I learned a lot by redoing it.
source share