Skip to content

Instantly share code, notes, and snippets.

@daveknapik
Created November 21, 2012 16:04
Show Gist options
  • Save daveknapik/4125684 to your computer and use it in GitHub Desktop.
Save daveknapik/4125684 to your computer and use it in GitHub Desktop.
Rails 3.1 UJS callback example implementation in CoffeeScript
$ ->
$("#search-form").on
"ajax:beforeSend": (e, xhr, settings) ->
console.log e
console.log xhr
console.log settings
"ajax:success": (e, data, status, xhr) ->
console.log e
console.log data
console.log status
console.log xhr
"ajax:complete": (e, xhr, status) ->
console.log e
console.log xhr
console.log status
"ajax:error": (e, xhr, status, error) ->
console.log e
console.log xhr
console.log status
console.log error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment