Previously, in rails 2.3.8 i used the prototype-helpers link_to_remote and form_remote_for (amongst others).
These had the option :u
The related rails 4 guide can be found at: http://guides.rubyonrails.org/working_with_javascript_in_rails.html
It points to the documentation of the events at: https://github.com/rails/jquery-ujs/wiki/ajax , as mentioned by ncherro
The actual values passed to the callbacks can be inferred from jQuery's ajax method http://api.jquery.com/jquery.ajax/#jQuery-ajax-settings
.bind is deprecated in favor of .on by jQuery: http://api.jquery.com/on/
So now the recommended approach is:
Template:
<%= link_to 'Click me!',
'path/to/ajax',
remote: true,
id: 'button',
method: :get,
data: {type: 'text'}
%>
CoffeScript:
$(document).ready ->
$("#button").on("ajax:success", (e, data, status, xhr) ->
alert xhr.responseText
).on "ajax:error", (e, xhr, status, error) ->
alert "error"