Created
December 12, 2008 15:18
-
-
Save r38y/35149 to your computer and use it in GitHub Desktop.
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
$(function(){ | |
$('#add_note').livequery(function(){ | |
$(this).ajaxForm({ | |
dataType: 'script', | |
beforeSubmit: function(data, form, options) { | |
form.find('.dots').show() | |
} | |
}) | |
}) | |
} | |
function updateNotes(partial){ | |
$('#drawing_notes').replaceWith(partial) | |
} |
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
# passes through erb so the partial is inserted | |
# then returned to the browser and evaluated since the | |
# request dataType was "script" | |
updateNotes(<%= partial 'drawing_notes', :locals => { :drawing => @drawing } %>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment