title: How to edit associations as a single entity
body: <p>I have a web app where I have <strong>posts</strong>, and each post has and belongs to many <strong>tags</strong>. I want the tags associated with each post to be editable using a single text field, as a comma separated list. This allows tags to be added, removed and edited(a removal and an addition). However, my web app has no idea what is removed and deleted, as it is just passed an array of tags that I want the post to have.</p>
  
  <p>I can think of 2 ways of handling this:</p>
  
  <ol>
  <li>Remove all the associations between tags and the post, and rebuild them.</li>
  <li>Fetch an array of tags before editing, do a comparison to find out which ones to add an remove.</li>
  </ol>
  
  <p><strong>What is the best way of handling this situation, and why?</strong></p>