# Link\_to\_remote loadind indicator problem

**URL:** <https://www.ruby-forum.com/t/link-to-remote-loadind-indicator-problem/129704>\
**Category:** Rails\
**Created:** [February 20, 2008, 9:04pm UTC](https://www.ruby-forum.com/t/link-to-remote-loadind-indicator-problem/129704 "2008-02-20T21:04:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [February 20, 2008, 9:04pm UTC](https://www.ruby-forum.com/t/link-to-remote-loadind-indicator-problem/129704/1 "2008-02-20T21:04:10Z")

</div>

Hi,

This is a bit of a strange one but i basically i have a link\_to\_remote  
which takes the value from an autocomplete field and puts it in a  
table by rendering a partial via ajax.

I have a before and success to display a spinning image before and  
hide it when complete. What is happening is the spinning image is  
being displayed when i click the link\_to\_remote but dissappearing  
straight away and then a second or so later my partial is rendered.  
If i remove the autocomplete box and put a select drop down menu as a  
test this works fine.

Ive tried the different options from the api like :loading =\> but  
still have the same problem with the autocomplete box. Ive tried  
everything i can think of. Has anyone any ideas?? code is below.

\<%= link\_to\_remote “Add Company to News”, :url =\> {:action =\>  
‘add\_company\_news\_row’},  
:before =\>  
“Element.show(‘loading’)”,  
:success =\>  
“Element.hide(‘loading’)”

\<%=image\_tag 'spinner.gif', :alt =\> 'Updating...'%\> Updating Please Wait...

JB
