# :afterFinish not getting called?

**URL:** <https://www.ruby-forum.com/t/afterfinish-not-getting-called/52641>\
**Category:** Rails\
**Created:** [January 17, 2006, 10:32am UTC](https://www.ruby-forum.com/t/afterfinish-not-getting-called/52641 "2006-01-17T10:32:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [January 17, 2006, 10:32am UTC](https://www.ruby-forum.com/t/afterfinish-not-getting-called/52641/1 "2006-01-17T10:32:51Z")

</div>

I am attempting to remove an element in the :afterFinish callback of the  
“Squish” effect. This is what my call looks like.

\<%= link\_to\_remote (“X”,  
:url =\> { :action =\> “deleteIt”,  
:id =\> wc\_line.attributes[‘id’],  
:exercise\_id =\> wc\_line.attributes[‘exercise\_id’] },  
:complete =\> visual\_effect(:squish,  
“item\_#{wc\_line.attributes[‘id’].to\_s}”, { :afterFinish =\>  
“function(effect) { Element.Destroy(effect.element);  
Sortable.create(’#{dow}eList’,  
#{options\_for\_javascript(sortable\_options)}) }” }) )  
%\>

After I click the above link the squish effect hides the element  
properly, but when I reorder my list and go to update each element’s  
position, the element ID still exists within the list (showing that the  
item was hidden, but that my Element.Destroy in my afterfinish callback  
was never called).

Can anyone point out any flaws with the above call?

TIA.

Jim
