Allright, lets say I have a User and every user hasMany EmailAddresss.
I have created the following view, to show a single user:
<h2>
<?php echo $user['User']['username']?>
</h2>
<h3>Addresses</h3>
<table>
<tr>
<th>Friends</th>
</tr>
<?php foreach ($user['EmailAddress'] as $emailAddress): ?>
<tr>
<td><?php echo $emailAddress['address']; ?></td>
</tr>
<?php endforeach; ?>
</table>
Now I want to create in this User view, an input box, that can add a new EmailAddress associated to that account. How can I do this?
Create a form pointing to EmailAddressController/add method
This PHP should create a FORM that points to your emailaddresses/add controller/action pair. In that Add action, you’ll handle the POST and add the email and redirect back to this page.
EDIT : Added
echos! as @Tim mentioned