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 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---