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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
<%= form_remote_tag :url => {:action => ''search''}, :complete => "new Effect.Appear(''div_list'')", :before => %(Element.show(''spinner'')), :update => ''div_list'', :success => %(Element.hide(''spinner'')) %> <label for="name">Name:</label> <%= text_field_tag ''name''%> <%= submit_tag "Search" %> <%= image_tag ''spinner.gif'', :id => ''spinner'', :style => ''display: none'' %> <%= end_form_tag %> <div id="div_list"></div> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Peter De Berdt
2007-Jun-26 10:37 UTC
Re: Show a loading image while a new view is rendered
On 26 Jun 2007, at 12:33, Chamnap wrote:> <%= form_remote_tag :url => {:action => ''search''}, > :complete => "new Effect.Appear(''div_list'')", > :before => %(Element.show(''spinner'')), > :update => ''div_list'', > :success => %(Element.hide(''spinner'')) %> > <label for="name">Name:</label> > <%= text_field_tag ''name''%> > <%= submit_tag "Search" %> > <%= image_tag ''spinner.gif'', :id => ''spinner'', :style => ''display: > none'' %> > <%= end_form_tag %> > > <div id="div_list"></div>And if you want to find a spinner, generate one with http:// www.ajaxload.info/ for example. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Peter De Berdt wrote:> On 26 Jun 2007, at 12:33, Chamnap wrote: > >> <%= end_form_tag %> >> >> <div id="div_list"></div> > > And if you want to find a spinner, generate one with http:// > www.ajaxload.info/ for example. > > > Best regards > > Peter De BerdtThanks...but it stills doesn''t work! No errors, it generates the render but i don''t see the image. ************************* BEGIN CODE ************************************* <div class="depot-form" > <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 %> </p> <p> <label for="module" >Module:</label> <%= text_field_tag :module, params[:module], :size => 50 %> </p> <p> <label for="server" >Server:</label> <%= select_tag ''server'', options_for_select(AuditorController::SERVERS) %> </p> <p> <%= 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> <br/> </p> <%= end_form_tag %> </fieldset> </div> ************************* END CODE *************************** -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It works! Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---