Tutorials for photoshop, javascript, php, html, css, flash, and more!

tutorials for photoshop, javascript, and php
   The Machine | Search for a cog | Submit a cog

Creating Two Models in One Form

Q: How do I make a form that handles multiple models?

This question is asked quite frequently. Scaffolding and simple Rails tutorials show you how to create one model per form. Unfortunately, sometimes this is not sufficient.

In this article we will make one form that creates two models: Project and Task (where a project has many tasks). What I would like to do is have the first task be created the same time the project is created (in the same form).

http://www.railsforum.com/viewtopic.php?id=717