Reputation: 91
I'm a Rails newbie, and interested in creating a notification model for Users. I don't want to use email for the notification, but instead have a facebook-style flag at the top of the profile page, that keeps a count of new comments or other events. I've searched around, and there doesn't seem to be any tutorial directly on point.
My biggest question is how to determine which comments/events are "new" since the User last viewed his dashboard/profile page. Right now, my only idea is to create a separate table with User_id, and Time_Checked. When the User views his show page, I would enter the current time into the database. I've looked at the Railscast on Faye, and read about Pusher, but those seem more advanced and related to Ajax-style notifications. Right now, I'm looking for something basic just to get some hands-on experience.
Upvotes: 2
Views: 412
Reputation: 125
What I did was by simply using a 'read' boolean instead of 'time-checked (just like how email works). The notification is automatically 'read' every time the dashboard controller action is called.
Upvotes: 0