Created
July 24, 2009 08:47
-
-
Save nachocab/153922 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
jQuery.fn.getWithAjax = function() { | |
this.unbind('click', false); | |
this.click(function() { | |
$.get($(this).attr("href"), $(this).serialize(), null, "script"); | |
return false; | |
}) | |
return this; | |
}; | |
function ajaxLinks(){ | |
$('.ajaxForm').submitWithAjax(); | |
$('a.get').getWithAjax(); | |
$('a.post').postWithAjax(); | |
$('a.put').putWithAjax(); | |
$('a.delete').deleteWithAjax(); | |
return false; | |
} | |
$(document).ready( function(){ | |
ajaxLinks(); | |
}); |
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
<% if !@note_groups.blank? %> | |
$("#note_groups").html("<%= escape_javascript( render :partial => 'note_group', :collection => @note_groups ) %>") | |
<% else %> | |
$("#note_groups").html("<%= escape_javascript( render :partial => 'empty_note_group') %>") | |
<% end %> | |
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
#note_groups | |
=link_to 'Click here to see all note groups", note_groups_path, :class => 'get' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment