I have a small form on the page that looks like
<div id="updater">
<%= form_for current_user,:remote=>true do |f| %>
please update your <%= f.label @field %>:
<%= f.text_field @field %>
<%= f.submit %>
<% end %>
</div>
This triggers the Users#update which has respond_to format.js
update.js.erb is
$("#updater").bind("ajax:success", function(xhr, data, status) {
$("#updater").remove();
});
so the form will disappear once the the field has been updated
I see that the JS is sent on the network tab on the chrome inspect thingy and the field does update in the DB. yet the #updater doesn’t disappear, not if I add alert("updater"); I don’t see the alert.
Am I not catching the ajax:success correctly?
I seem to have another js file that is working on #updater.. once I removed that it started working..