Show a loading image while a new view is rendered

I need a help in here…

I wanna show a loading image after i click a submit tag (button). This
button generates a list of items and i wanna show the image while the
list is created.
What show i do? Does the ruby have some kind of control? Where to put
the code? In the view? The Layout?

Thanks in advance

mffreire

<%= form_remote_tag :url => {:action => ‘search’},
:complete => “new Effect.Appear(‘div_list’)”,
:before => %(Element.show(‘spinner’)),
:update => ‘div_list’,
:success => %(Element.hide(‘spinner’)) %>
Name:
<%= text_field_tag ‘name’%>
<%= submit_tag “Search” %>
<%= image_tag ‘spinner.gif’, :id => ‘spinner’, :style => ‘display:
none’ %>
<%= end_form_tag %>

On 26 Jun 2007, at 12:33, Chamnap wrote:

<%= end_form_tag %>

And if you want to find a spinner, generate one with http://
www.ajaxload.info/ for example.

Best regards

Peter De Berdt

It works! Thanks.

Peter De Berdt wrote:

On 26 Jun 2007, at 12:33, Chamnap wrote:

<%= end_form_tag %>

And if you want to find a spinner, generate one with http://
www.ajaxload.info/ for example.

Best regards

Peter De Berdt

Thanks…but it stills doesn’t work! No errors, it generates the render
but i don’t see the image.

************************* BEGIN CODE


<fieldset>
    <legend>Please enter CVS credentials </legend>
    <%= start_form_tag %>
     <p>
      <br/>
      <label for="name" >Username:</label>
       <%= text_field_tag :name, params[:name], :size => 50 %>
     </p>
    <p>
     <label for="password" >Password:</label>
      <%= password_field_tag :password, params[:password], :size => 

50 %>



Module:
<%= text_field_tag :module, params[:module], :size => 50 %>



Server:
<%= select_tag ‘server’,
options_for_select(AuditorController::SERVERS) %>


    <%= form_remote_tag :url => {:action => 'checkpre'},
   :complete => "new Effect.Appear('div_list')",
   :before => "Element.show('spinner')",
   :update => 'div_list',
   :success => "Element.hide('spinner')" %>
    <%= submit_tag "Check Compliance" %>
    <%= image_tag "spinner.gif", :id => 'spinner', :style => 

‘display:none’ %>
<%= end_form_tag %>

    <div id="div_list"></div>

<%= end_form_tag %>
</fieldset>

************************* END CODE ***************************

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs