I have a series of div
s, and each one has a delete link. Each one also has a currently hidden spinner image. Idea is that when the delete link is pressed (and the object in the div
is being deleted), the spinner is displayed. Once the AJAX call to delete the object is done, then the div
item is removed from the series.
My problem here is basically getting the spinner image to display.
This is the code I am using:
def destroy_object(object)
update_page do |page|
page.show "spinner-del-#{object.id}"
end
remote_function(
:url => url_for(object),
:method => :delete
)
end
The remote_function portion calls an rjs which removes the relevant div
properly, so that's not an issue. However, the update_page
section to show the spinner isn't working, and I really can't figure out why.
Any ideas? Thanks!