I’ve created a simple webapp with user authentication. I’ve made two models: Users for user authentication and Details for additional user details. They are associated with one-to-one relationship. I’m having problems with updating two models from the same controller.
Is one-to-one association recommended at all in this case (I’m not willing to shove too many fields in one table), and if so, what is the proper way of handling two models via one controller?
Check Nested Model Form Part 1/2 by rails cast. Checkout the rails cast and you can surely figure out 🙂 Its explained for many to many relationships, minor tweeks and you can do it for one to one.
Some sample code you may want to see: