I'm trying to add a like button to my rails site so I've looked at the acts_as_votable gem and the Active Record Reputation System gem. However, both of these require a User Model (I think), and I want to make the like button something that anyone can click whether they are signed in or not.
Is there a way to make one of these gems function like that, or will I have to create the voting system from scratch? Also, if I do have to do it from scratch, some guidelines to approaching it would be helpful.
I'd create another model called
Likeand then create aone to many associationbetweenImageandLike.then update your database by running
then you'll want to create the association.
Then when someone clicks on the like button, you'll want to create a
new Likewith theidof theImageI hope this helps.