Hello again I have a scenario where I am going to have a div that periodically updates information from the server (think like a newsfeed or stock ticker). I am using AJax on the browser side to accomplish this now. However, I am wondering if it is possible for when the update request comes in to the server If it is determined that the content hasn''t changed to send back an "abort update" somehow to the browser that would cause the div to remain unchanged. I am fairly new to the Prototype classes in general so I am not even sure where to begin with this. Ben -- 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 -~----------~----~----~----~------~----~------~--~---
Hi Ben, Darushin wrote:> I have a scenario where I am going to have a div that periodically > updates information from the server (think like a newsfeed or stock > ticker). I am using AJax on the browser side to accomplish this now. > However, I am wondering if it is possible for when the update request > comes in to the server If it is determined that the content hasn''t > changed to send back an "abort update" somehow to the browser that would > cause the div to remain unchanged. I am fairly new to the Prototype > classes in general so I am not even sure where to begin with this.In your RJS template, or in the controller if that''s where you''re currently doing the render, page.render :nothing => true will accomplish what you''re looking for. hth, Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
If you''re using an RJS template to return JavaScript to the browser couldn''t you just return an empty response so that your page doesn''t update. What happens if you do something like this in your RJS template: page.replace_html("cart", :partial => "cart", :object => @cart) if @cart.has_changes? Of course you would need to provide the has_changes? method on your object. I can''t guarantee this will work because I''ve not tested this. But, give it a shot and see what happens. On Apr 26, 1:24 pm, Darushin <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hello again > > I have a scenario where I am going to have a div that periodically > updates information from the server (think like a newsfeed or stock > ticker). I am using AJax on the browser side to accomplish this now. > However, I am wondering if it is possible for when the update request > comes in to the server If it is determined that the content hasn''t > changed to send back an "abort update" somehow to the browser that would > cause the div to remain unchanged. I am fairly new to the Prototype > classes in general so I am not even sure where to begin with this. > > Ben > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---