title: How to trigger events upon the completion of a best_in_place edit?
body: <p>In the show page, I display a list of dates of the occurrence of a periodic event, and statistics calculated ver all the dates such as max, min, and average interval between successive dates.</p>
  
  <p>I use the best_in_place gem to allow in-place editing of the dates. However, each time a date is changed, the statistics must be calculated and re-rendered from the server.</p>
  
  <p>How do I hook a callback function to the completion of the best_in_place edit, so that the stats can be re-rendered? </p>
  
  <p>This is my Rails code in show.html.erb</p>
  
  <pre><code>&lt;td id="event_date"&gt;
    &lt;%= best_in_place @event, :occur_date %&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>which in html is </p>
  
  <pre><code>&lt;td id="event_date"&gt; 
      &lt;span class='best_in_place' id='best_in_place_event_132_occur_date' data-url='/events/132' data-object='event' data-attribute='occur_date' data-type='input'&gt;2012-03-23&lt;/span&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>I tried the following coffee script code:</p>
  
  <pre><code>jQuery -&gt;
  $("#best_in_place_event_*_occur_date").live 'ajax:complete', (evt, data, status, xhr) -&gt;
    alert "a date has changed"
  </code></pre>
  
  <p>This doesn't seem to work, nothing happens after I edit a date (occur_date). </p>
  
  <p>Anyone knows how I should trigger an event upon a successful best_in_place edit?</p>