I believe that google actually refreshes periodically - not the html page,
but gmail is basically one big javascript framework so it amounts to the
same thing.
anyway, what you can do is create a periodic call to the server - every 10
seconds, 30 seconds, whatever - to check if there is a new entry - if there
is no new entry, do nothing (user doesn''t experience anything) - if
there is
new entry you can insert the new entry using page.insert instead of
reloading the entire page. you can also update a section showing when last
the page was updated.
that would be my suggestion, but I am sure there are other people who can
suggest alternatives
regards
ivor
On 10/3/07, Barabule Muci
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
>
> Hello,
> I have made an message send/receive system for my page in ruby on rails.
> It works great but the only thing is that i need to refresh every time
> the page to see if i have new messages. Could someone help me with a
> tutorial, or example of how to send alert from server to user window
> when he get a new message.
> I don''t wan''t to put an observer function to refresh the
page every 10
> seconds. I wan''t to tell to the application when a new row is
inserted
> in message table to notice user that he gets a new message(like google).
> 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
-~----------~----~----~----~------~----~------~--~---