From d0b251e986ebbf4358ec9d339367387f32d74792 Mon Sep 17 00:00:00 2001 From: David Fernandez Date: Thu, 13 Feb 2014 11:37:34 +0100 Subject: [PATCH] Fix coffeescript sample [ci skip] Replace bind() with on() as suggested by the JQuery bind() documentation: https://api.jquery.com/bind/ --- guides/source/working_with_javascript_in_rails.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/working_with_javascript_in_rails.md b/guides/source/working_with_javascript_in_rails.md index 3c04204c29..a8695ec034 100644 --- a/guides/source/working_with_javascript_in_rails.md +++ b/guides/source/working_with_javascript_in_rails.md @@ -180,7 +180,7 @@ bind to the `ajax:success` event. On failure, use `ajax:error`. Check it out: $(document).ready -> $("#new_post").on("ajax:success", (e, data, status, xhr) -> $("#new_post").append xhr.responseText - ).bind "ajax:error", (e, xhr, status, error) -> + ).on "ajax:error", (e, xhr, status, error) -> $("#new_post").append "

ERROR

" ```