# Create a new parent on child form?

**URL:** <https://www.ruby-forum.com/t/create-a-new-parent-on-child-form/169675>\
**Category:** Rails\
**Created:** [June 6, 2009, 8:09pm UTC](https://www.ruby-forum.com/t/create-a-new-parent-on-child-form/169675 "2009-06-06T20:09:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/82dd89/32.png) [@jeremy](https://www.ruby-forum.com/u/jeremy)\
**Post date:** [June 6, 2009, 8:09pm UTC](https://www.ruby-forum.com/t/create-a-new-parent-on-child-form/169675/1 "2009-06-06T20:09:31Z")

</div>

I’m creating a little event management system and I have an Event  
model and an Organization model.

# event.rb

belongs\_to :organization

# organization.rb

has\_many :events

When I’m creating a new event, I present a dropdown with already saved  
organizations, but I’d like to add a “Create new organization” option  
in there and then use Javascript to show the New organization form,  
and then have the new event and new organization saved when submitted.

The javascript is not the problem, but figuring out the rest is. I’ve  
read over the tutorials where you can do nested models, but those seem  
to only work _from_ the parent (i.e. if I were creating a new  
organization and wanted to create a bunch of new events at the same  
time) rather than vice versa.

Can anyone help me out?
