I'm trying to get some better logic behind this before I start writing code.
I have a model that collects new messages via a background process. (So the database gets updated every 2-3 mins with any new messages).
When the user comes to their inbox, they're presented with all their current messages. This is easy for me:
@user = User.find(params[:id])
@user.messages
And I show the user's current messages on the page.
However, what if a new message comes in while the user is on that page (or any other page), how can I update the page w/ the new message without requiring a full page refresh. I know this can be done via ajax (periodically_call_remote?) . But i'd like to only highlight (fade/blink) only the NEW message that comes in.
Trying to wrap my ahead around this. My current solution is to use a partial for the inbox, which calls another partial of inbox messages. But how can I update the page with just "NEW" messages periodically? Say, to check every 2 mins or so.
Ideas?