# 1 Form, 3 Models?

**URL:** <https://www.ruby-forum.com/t/1-form-3-models/149909>\
**Category:** Rails\
**Created:** [October 1, 2008, 12:50am UTC](https://www.ruby-forum.com/t/1-form-3-models/149909 "2008-10-01T00:50:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@jason](https://www.ruby-forum.com/u/jason)\
**Post date:** [October 1, 2008, 12:50am UTC](https://www.ruby-forum.com/t/1-form-3-models/149909/1 "2008-10-01T00:50:30Z")

</div>

I want to make a single form, but it will potentially create 3 new  
models. There are relationships between these models (belongs\_to). I  
have also generated the sections with scaffolding and created form  
partials.

For example, I have a form for a Project (1). This project references  
a Manager (2) and Team (3). In this form, I would like for a user to  
be able to submit a project and either enter this information as new  
or lookup the info (autocompleter I can handle). On the “back-end” I  
would need to be able to save any new Manager and Team data and create  
the necessary relationships…

So my question is, what is the best way to leverage RoR to display and  
save these forms??

---

<div class="post-metadata">

**Author:** ![jason](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@jason](https://www.ruby-forum.com/u/jason)\
**Post date:** [October 1, 2008, 1:09am UTC](https://www.ruby-forum.com/t/1-form-3-models/149909/2 "2008-10-01T01:09:48Z")

</div>

The Handle Multiple Models in One  
Form[http://media.pragprog.com/titles/fr\_arr/multiple\_models\_one\_form.pdf](http://media.pragprog.com/titles/fr_arr/multiple_models_one_form.pdf)extract  
from Advanced  
Rails Recipes [http://pragprog.com/titles/fr\_arr/advanced-rails-recipes](http://pragprog.com/titles/fr_arr/advanced-rails-recipes)  
is  
quite good.

Regards,  
Craig

---

<div class="post-metadata">

**Author:** ![jason](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@jason](https://www.ruby-forum.com/u/jason)\
**Post date:** [October 1, 2008, 3:16am UTC](https://www.ruby-forum.com/t/1-form-3-models/149909/3 "2008-10-01T03:16:09Z")

</div>

I think the complex forms series with Ryan B. talks about this as  
well.

Ramon T.

---

<div class="post-metadata">

**Author:** ![jason](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@jason](https://www.ruby-forum.com/u/jason)\
**Post date:** [October 1, 2008, 3:20am UTC](https://www.ruby-forum.com/t/1-form-3-models/149909/4 "2008-10-01T03:20:16Z")

</div>

Thanks for the quick response!

On Sep 30, 9:05 pm, “Ramon Miguel M. Tayag” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
