Ajax Form: Save One Related Model Instance At A Time

Hello there!

I’m currently trying to code a webapp where (music)artists can submit a release.

I have a CRUD for release, and a bunch of related models, many of them with MANY_MANY relations.

One of them is Track (track_name, track_number, dics_number etc.) and I would like to be able to display

the tracks to the user, as they are added to the Release form.

For now i have used renderPartial() to display the Track form inside the Release form:

$trackView = $this->renderPartial(’//track/_form’, array(‘track’=>$track), true);

$this->render(‘create’, array(

        'model' => $model,


        'trackView' => $trackView))

and then I just echo $trackView in _form.php

OK! Now I would like to use AJAX to print the name of the tracks being submitted, next to the form.

And all of the Track models to be submitted with the rest of the Release form.

I hope you can help

Ruben