I am trying to build a form that consists of Subjects, which belong to SubjectGroups. Visually, the subjects are shown on the page under headings of each subject group. You will be able to edit the name of a subject group or an individual subject.
If I were to give you an example of the HTML:
<div class="heading">
<input type="text" value="Subject Group 1" />
</div>
<input type="text" value="Subject 1" />
<input type="text" value="Subject 2" />
<input type="text" value="Subject 3" />
<div class="heading">
<input type="text" value="Subject Group 2" />
</div>
<input type="text" value="Subject 4" />
<input type="text" value="Subject 5" />
<input type="text" value="Subject 6" />
...
How do I build the form using Cake's FormHelper that will allow me to update multiple rows like this?
How do I then validate and update both the SubjectGroup and Subject models?
How do I process many instances of each model (subject 1, subject 2, etc.)?