Created
May 31, 2012 12:25
-
-
Save Hampei/2843052 to your computer and use it in GitHub Desktop.
rails jquery coffeescript to throw remote-form reponse into a given element.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# response-html of forms replace the innerHTML of given element. | |
# usage <form data-remote='true' data-replace-element='#replace_my_contents'>... | |
$(document).on("ajax:success", "form[data-replace-element]", (el, data, status, xhr) -> | |
$($(this).data('replace-element')).html(data); | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment