1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix coffeescript sample [ci skip]

Replace bind() with on() as suggested by the JQuery bind() documentation: https://api.jquery.com/bind/
This commit is contained in:
David Fernandez 2014-02-13 11:37:34 +01:00
parent 6e61da2dab
commit d0b251e986

View file

@ -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 "<p>ERROR</p>"
```