I have a simple form:
= form_for(posts_path, :id => "new_post", :remote => true) do
= text_field_tag "post[input]"
= submit_tag "Post!"
I have bound a callback to the ajax:success
event:
$("form#new_post").bind("ajax:success", function(xhr, data, status){
alert("Post Created!");
});
When I click the Post!
button, the Post Created
comes up twice. Why?
I'm using Rails 3.1 which by default is using jquery-ujs.