Good point, but the value of the loading div is its immediacy in the user experience. So using javascript rather than ajax even if there is a trip to the server still has the advantage of being faster.
On Sat, Apr 19, 2008 at 4:54 AM, Greg Newman <[EMAIL PROTECTED]> wrote: > Good point Scott, however, I'm assuming since he's using observe_field > that he's doing a round trip to process something. > > > On Fri, Apr 18, 2008 at 11:15 AM, Scott Ballantyne < > [EMAIL PROTECTED]> wrote: > > > I don't think you need ajax, just javascript. > > if using prototype something like > > Element.show('loading') > > this should work if you have a div with an id that's loading. > > no need to make a round trip to the server. > > > > On Fri, Apr 18, 2008 at 11:04 PM, Greg Newman <[EMAIL PROTECTED]> > > wrote: > > > > > Exactly what Scott said. Put it in a hidden div and show the div with > > > ajax. > > > > > > > > > On Fri, Apr 18, 2008 at 11:01 AM, Scott Ballantyne < > > > [EMAIL PROTECTED]> wrote: > > > > > > > you might consider including the loading stuff in a hidden div, and > > > > then, when you trigger something with the observe field, you can use > > > > some > > > > javascript to show it. I think that this should work. Any other > > > > thoughts? > > > > > > > > > > > > On Thu, Apr 10, 2008 at 9:15 PM, Ray Sun < > > > > [EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > I want to use render(:partial => "loading") in observe_field's > > > > > before. > > > > > For example: > > > > > > > > > > # Can not run # > > > > > <%= observe_field 'username', > > > > > :on => 'blur', > > > > > :update => 'check_username', > > > > > :url => {:action => 'check_username'}, > > > > > :before => > > > > > "$('check_username').update('#{render(:partial => "loading")}')", > > > > > :with => 'username' -%> > > > > > # AJAX part, generate two lines > > > > > > > > > > # Can run # > > > > > <%= text_field_tag 'username' %> > > > > > <span id="check_username"></span> > > > > > <%= observe_field 'username', > > > > > :on => 'blur', > > > > > :update => 'check_username', > > > > > :url => {:action => 'check_username'}, > > > > > :before => "$('check_username').update('<img > > > > > src=\"/images/loading.gif\">Checking...')", > > > > > :with => 'username' -%> > > > > > # AJAX part, generate only one line > > > > > > > > > > # partial > > > > > <%= img_tag "/images/loading.gif" %>Loading... > > > > > -- > > > > > Posted via http://www.ruby-forum.com/. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Greg Newman > > > Rails Developer & Designer > > > Owner, carbon8.us > > > Blog, 20seven.org > > > > > > > > > > > > > > > > > > -- > Greg Newman > Rails Developer & Designer > Owner, carbon8.us > Blog, 20seven.org > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Deploying Rails" group. To post to this group, send email to rubyonrails-deployment@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-deployment?hl=en -~----------~----~----~----~------~----~------~--~---