Skip to content

Instantly share code, notes, and snippets.

@r38y
Created December 12, 2008 15:18
Show Gist options
  • Save r38y/35149 to your computer and use it in GitHub Desktop.
Save r38y/35149 to your computer and use it in GitHub Desktop.
$(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)
}
# 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