Answer the question
In order to leave comments, you need to log in
Has anyone found an implementation of facebook voting emotes?
I want to do things like Facebook for blog posts. But I can't find a ready-made solution anywhere. Maybe someone met? Ideally, this should be in conjunction with acts_as_votable. I can write it myself, but I'm looking for a ready-made solution.
They are called reactions, right?
Answer the question
In order to leave comments, you need to log in
As I see it, you create an enum with types of reactions (0 -like, 1 - love, etc.), in the database you create a link table with columns user_id, post_id, reaction (uniqueness for the first pair of keys). When opening a post, load from this table all likes by post_id + user_id, grouping by reaction with COUNT counting. In the backend, make an /ajax/react handler and send reaction_id, post_id there depending on the button pressed and update the link table according to this data.
UPD: I didn't read that you are looking for ready-made
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question