bernat/best_in_place — pull request #166 by gposton (2012-07-05 03:56:59+00:00)
Title: add classes to best_in_place span

This enables customizing the span, but furthermore it allows us to bind different success callbacks to particular fields. Here is and excerpt I added to the README:

To bind a callback that is specific to a particular field, use the 'classes' option in the helper method and
then bind to that class.

<%= best_in_place @user, :name, :classes => 'highlight_on_success' %>
<%= best_in_place @user, :mail, :classes => 'bounce_on_success' %>

$('.highlight_on_success').bind("ajax:success", function(){$(this).closest('tr').effect('highlight'));});
$('.bounce_on_success').bind("ajax:success", function(){$(this).closest('tr').effect('bounce'));});