public
Last active

  • Download Gist
README.md
Markdown

Where, instead of my inefficient approach, I execute XHR JavaScript responses. Behaves just like JangoSteve said it should for 400 or 424 HTTP response status codes.

Binds the event on $(document) so that dynamically created forms will be affected, too.

callback.js
JavaScript
1 2 3 4 5
$(document).ready(function() {
$(document).on('ajax:error', 'form[data-remote="true"]', function(evt, xhr, status) {
eval(xhr.responseText);
});
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.