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:
parent
6e61da2dab
commit
d0b251e986
1 changed files with 1 additions and 1 deletions
|
@ -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>"
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue