what could be a reason for my js to be displayed on the screen for a second before it catches and does what it''s supposed to? I''ve had this happen when I call page.reload inside render :update block... <%= link_to_remote ''reload'', :update => ''my_div'', :url => {:action => ''reload_page''} %> def reload_page respond_to do |format| format.js do render(:update) do |page| page.reload end end end end yup, rails newb. -- 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 -~----------~----~----~----~------~----~------~--~---
On 6 Jan 2009, at 14:22, Shilo Ayalon wrote:> > what could be a reason for my js to be displayed on the screen for a > second before it catches and does what it''s supposed to? I''ve had this > happen when I call page.reload inside render :update block... >Don''t pass :update to link_to_remote if you''re using render :update Fred> <%= link_to_remote ''reload'', > :update => ''my_div'', > :url => {:action => ''reload_page''} %> > > def reload_page > > respond_to do |format| > format.js do > render(:update) do |page| > page.reload > end > end > end > > end > > > yup, rails newb. > -- > 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 6 Jan 2009, at 14:22, Shilo Ayalon wrote: > >> >> what could be a reason for my js to be displayed on the screen for a >> second before it catches and does what it''s supposed to? I''ve had this >> happen when I call page.reload inside render :update block... >> > Don''t pass :update to link_to_remote if you''re using render :update > > FredRight, that was the problem. 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 -~----------~----~----~----~------~----~------~--~---