# 'double' nest form fields with accepts\_nested\_attributes\_for

**URL:** <https://www.ruby-forum.com/t/double-nest-form-fields-with-accepts-nested-attributes-for/172811>\
**Category:** Rails\
**Created:** [July 28, 2009, 12:57pm UTC](https://www.ruby-forum.com/t/double-nest-form-fields-with-accepts-nested-attributes-for/172811 "2009-07-28T12:57:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdaoust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Post date:** [July 28, 2009, 12:57pm UTC](https://www.ruby-forum.com/t/double-nest-form-fields-with-accepts-nested-attributes-for/172811/1 "2009-07-28T12:57:14Z")

</div>

Hi

Is it possible to ‘double’ nest form fields with  
accepts\_nested\_attributes\_for?  
Something like:

`<% form_for parent do |parent_form| %>
  <% parent_form.fields_for parent_children do |parent_children_fields|
%>
      ...
         <% parent_children_fields.fields_for parent_child_activities do
| parent_child_activities_fields| %>
             ...`  
Rough example but should be enough for demonstration. What I’m trying to  
do is form a many to many join between parent and child while  
simultaneously creating a join to their activities. A parent has many  
children. A child has many parents. Parents and children together have  
many activities.

If this would be possible it would be a wonderful thing, though it  
depends on creation of the first level join before the second. Anyone  
have experience of this?
