A good example is the SO star on the left hand side of this post.
You can click on it to add this message in your favorite and click again to remove this flag.
I already create a page /favorites/add/{post_id}/ but how to handle that in Ajax ?
Many things to do :
- Be sure that it worked when you click
- Change the image
- Change the link if it is to add or remove the flag.
I am sure such a thing already exists, but I couldn't find it.
Any idea ?