Rails Facebook-like Notifications - ruby-on-rails

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.

Related

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

Facebook like user search as you type

I am creating a messaging system for my web app and need help with searching for users to send messages to. So far I have it so that if you type a persons name (who is on the site) you can send a message to them. I want it to be as you start typing a persons name, a drop down appears with users names that the current user is following. Any thoughts on how I can do this?
I am using the gem mailboxer also wondering if anyone has suggestions for a better messaging gem. Thanks in advance.
Use jQuery autocomplete, and just populate the dropdown contents as all users that the user is following... something like current_user.followed_users. It's impossible to give code without seeing how your code works though.
A good alternative to jquery autocomplete is http://loopj.com/jquery-tokeninput/ and github at: https://github.com/loopj/jquery-tokeninput. A facebook like tagging to send message to multiple users. A demo app on https://github.com/railscasts/258-token-fields-revised/tree/master/bookstore-tokeninput-after from Ryan Bates from Railscasts http://railscasts.com/episodes/258-token-fields-revised
Good luck.

"Unsubscribe" for email categories/types through Sendgrid, Mailchimp, SES

I've got a Rails 3.2 app that will need to send various transactional & bulk (marketing) types of emails. Ideally I'd be able to use a service (like Sendgrid or Amazon SES) to improve deliverability and for unsubscribe support. I've mostly used Sendgrid in the past, but I need the 'unsubscribe' to be just for a specific category of the email (there are around 6 categories). I can't have someone unsubscribing from a marketing email and miss out on notification or invitation emails. Does anyone know of an service that supports this, or does this just have to be done internally? It seems like there's a lot to deal with related to best practices for deliverability, list-unsubscribe, etc. if you manage it yourself.
I see this discussion on sendgrid, but seems to be pending still:
http://community.sendgrid.com/sendgrid/topics/unsubscribe_and_categories
I'm happy to go with any service if it integrates relatively easily with Rails and can support category/type based subscription management. Or perhaps a hybrid approach with different services or separate accounts on the same service, if they allow that for the same domain?
I very much appreciate any feedback on how others have tackled this.
Thanks!
SendGrid is currently developing this feature and we hope to have it out shortly. There isn't an exact time for the release of this feature yet but it sounds like it is just what you are looking for. Check out SendGrid's blog, it will be updated when this feature is available for beta testing.
http://www.sendgrid.com/blog
Thanks
Brian
It looks like CritSend(1) have what they call "tag" support and state the following on their site:
Our unsub processing is done per tag, so if someone unsubscribes from
one of your emails tagged "newsletter1" that does not unsubscribe them
from any other tag.
The one thing that is unclear is the level of Ruby support.
CritSend name MxmConnect as the gem to use for sending emails. There is a critsend_events gem for the CritSend Events API.
(1) Note, I have no affiliation with CritSend

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.

How to implement notification system in RoR?

I finished Ruby on Rails tutorial where I can follow other users and others may follow me like twitter. Now I wonder how to implement notification system if someone starts to follow me, for example, as in stackexchange or facebook in which come and display a notification (eg red 1). How to go about it? Are there any examples of ready solutions you or MVC?
I'd add a before_filter to relevant controller actions that checks for new followers in the database and sets flash[:notice] to something useful like 'X new followers' and links to your followers page. There's a quick overview of how flash works in the docs: http://api.rubyonrails.org/classes/ActionDispatch/Flash.html
Have a look at those 2 railscasts:
http://railscasts.com/episodes/407-activity-feed-from-scratch
http://railscasts.com/episodes/406-public-activity.

Resources