Created
June 14, 2012 15:34
-
-
Save pazaricha/2931009 to your computer and use it in GitHub Desktop.
beforeSend - doesn't work at all
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
=simple_form_for(@transaction, :remote => true ) do |f| | |
=f.error_notification | |
=f.input :description | |
=f.input :amount | |
=f.collection_radio_buttons :kind, [['expense', 'Expense'] ,['income', 'Income']], :first, :last | |
=f.button :submit, "Create New Transaction", :class => "btn btn-primary btn-large", :name => "create_transaction" |
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
$('form#new_transaction') | |
.bind("ajax:beforeSend", function() { | |
alert("ajax:beforeSend has been triggered"); // Doesn't work...why? | |
}) | |
.bind("ajax:success", function(){ | |
alert("ajax:success has been triggered"); // Workes | |
}) | |
.bind("ajax:complete", function(){ | |
alert("ajax:complete has been triggered"); // Workes | |
}); |
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
$("#transaction-modal .modal-body").html("<%= escape_javascript(render :partial => "transactions/new") %>", function() { | |
$('#transaction-modal').modal('show'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment