I suggest you read this article:  
http://nuts-and-bolts-of-cakephp.com/2008/07/11/notes-on-cakephp-habtm-part-2-saving-data/

At the end you'll see a behavior where you can save one HABTM link at a 
time. Generally, you save all of the HABTM data because Cake wipes all of 
the current relationships and resaves them. That's the only way it knows 
not to get duplicates, or that you removed them. The HABTM behavior helps 
you save/delete single ones without needing to know the others, i.e., 
saving/removing one follower without knowledge of the other followers.

Your follow button should go to something like /users/follow which in turn 
uses (probably POSTed so you don't have spamming) data and the HABTM 
behavior to save that new follower.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to