Question: I've got an extension to this question: [How to deal with Form Collection on Symfony2 Beta?](https://stackoverflow.com/questions/5894570/how-to-deal-with-form-collection-on-symfony2-beta "How to deal with Form Collection on Symfony2 Beta?") - My project is similar, but the objects are nested deeper. I've got Articles which have one or more Content elements, each of which contains one or more Media. The Model and Controllers are working fine so far, but I don't know how to properly represent the nesting in my template.
Form/ContentType.php looks all right:

```
class ContentType extends AbstractType
{
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
            ->add('headline')
            ->add('text')
            ->add('medias', 'collection', array(
              'type'      => new MediaType(),
              'allow_add' => true
            ))
        ;
    }

```

And so far, the form template for creating (or editing) an Article looks like this (almost vanilla auto-generated template):

```
...
<form action="{{ path('article_create') }}" method="post" {{ form_enctype(form) }}>
    {{ form_widget(form) }}

    {% for content in form.contents %}
        {{ form_widget(content) }}
    {% endfor %}

    <p>
        <button type="submit">Create</button>
    </p>
</form>
...

```

How do I access each Content's Media so they get properly associated?

Answer: 
Iterate through all content's media:

```
<form action="{{ path('article_create') }}" method="post" {{ form_enctype(form) }}>
    {{ form_widget(form) }}

    {% for content in form.contents %}
        {% for media in content.medias %}
            {{ form_widget(media) }}
        {% endfor %}
    {% endfor %}

    <p>
        <button type="submit">Create</button>
    </p>
</form>

```
```
<form action="{{ path('article_create') }}" method="post" {{ form_enctype(form) }}>
    {% for media in form.contents.medias.children %}
         {{ form_widget(media) }}
    {% endfor %}
    {{ form_rest(form) }}
    <p>
        <button type="submit">Create</button>
    </p>
</form>

```