Created
February 17, 2017 17:22
-
-
Save Frank004/f5bfa82ee39aa010c637e948bef9b67a 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
#--------ba_partial------- | |
<%= bootstrap_form_for ba, remote: true, data_id: ba.id do |f| %> | |
... | |
<div id="loader" class='load-ajax hide'></div> | |
<% 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
$(document).ajaxStart(function() { | |
$("#loader").show(); | |
}).ajaxStop(function() { | |
$("#loader").hide('slow'); | |
}); |
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
#-------index------- | |
<% @baz.order("id DESC").each do |ba| %> | |
<%= render partial: 'ba_partial', locals: {ba: ba} %> | |
<% 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
$(document).on('submit', ".edit_ba", function( e ) { | |
e.preventDefault(); | |
$.ajax( { | |
url: $(this).attr('action'), | |
type: 'POST', | |
data: new FormData( this ), | |
processData: false, | |
contentType: false | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment