Building stackoverflow-like inbox in Rails - ruby-on-rails

Using rails and possibly the public_activity or paper_trail gem, how could I conceptually build a user inbox: which displays latest updates that are relevant to the user.
In stackoverflow's example, there are multiple things that trigger a notification:
When you get answers to your questions.
When someone posts a comment on your question or answer.
When someone posts an answer to a question you have also answered.
Should I create a table to push notifications into and mark them as viewed when the user has seen them? Or is there is a better way to accomplish this?
Any help would be greatly appreciated.

Related

How to mention someone in comments of gerrit?

Is there any way to mention someone when a comment/reply is added?
I've tried #someone but it doesn't help.
So far (Gerrit 3.0.0) you can't do that. It is requested for as a feature in Issue 3534.
The general workflow people tend to use is to either add as Reviewer/CC if some person is not already in it, so a notification will be sent.

Rails activity notification system

I've looked around StackOverflow at seemingly similar questions but nothing really seems to fit the bill.
I have a couple models that I would like users to be able to subscribe and unsubscribe to. If a user is subscribed to a video for example, they will receive notifications for things like comments.
I like the look of Github's notifications api which is built on rails but I can't seem to wrap my head around how I might replicate a similar architecture with my own models and controllers.
Please read the page I linked to above to the Github notifications API. If you think you can piece together how you might replicate this in rails please post some pseudo code of the models and the relationships they have to one another!
I don't have any experience with them, but I'd start your research here:
https://www.ruby-toolbox.com/categories/Rails_Activity_Feeds

Display random single survey poll in side bar, show results, next poll?

We're developing an app in Rails, and want to randomly display a question to users that they haven't seen yet. Once they answer, it would show the results, and then ask if they want to answer the next question.
Has anyone done this? Is there perhaps some kind of gem that can help us, or do we have to write it from scratch?
Thanks in advance!
I've used the randumb gem for something similar. With it you can use scopes to chain your queries so you could fetch only an un_seen record (and subsequently update it to seen)
https://github.com/spilliton/randumb

Rails Facebook-like Notifications

In my Rails 3 app I have Users, Products, and Likes. If a User posts a Product, and another User Likes this Product, I want that User to get a notification that their Product was Liked.
Is there an existing gem that handles this? I've only come across Pusher but that seems to be overkill.
There are a couple of gems that do that:
RailsActivity
https://www.ruby-toolbox.com/categories/Rails_Activity_Feeds
PublicActivity
http://railscasts.com/episodes/406-public-activity
https://github.com/pokonski/public_activity
I have never used them (although i probably will do it tomorrow ^^) so maybe someone with more experience can give you a better insight given your requirements (or read some part of the documentation)
All the gems that are mentioned above by different people is for implementing activity feed.There is lot of difference between implementing facebook news feed and facebook notification system.
For implementing notification system, I recommend you to check these links.
Gritter
Link
Have you seen this http://railscasts.com/episodes/260-messaging-with-faye ? Faye is used in the example. I'm not sure if you'd still consider it an overkill.

how to send notification to another user in rails

im trying to create a badge system similar to stackoverflows. i noticed that stackoverflow is able to send a notification to another user. for example, if i create a question, and 10 people upvoted my question, i receive a badge, not the current_user doing the upvoting.
how can i do that in rails? it seems sending a message to another user is out of the scope of flash messages. i did some research and maybe the faye gem seems like a possibility? however im not positive though. i was watching the railscasts and it seemed maybe better for a chatting system? is push-notification the way to go?
what would be a good way to do this? thank you
I can suggest to use this gem: https://github.com/dapi/gritter_notices
It is well handle with this problem, but it has two drawbacks:
Documentation on russian
Binding to the gritter
If you choose to use it, see what version of gritter you use. As I remember, the version of original gritter gone forward a bit.
This part of code does what you need.

Resources