i want to show all the posts users have upvoted on, how can I do this.
CodePudding user response:
Let's say you have such models
class Post < ApplicationRecord
acts_as_votable
end
class User < ApplicationRecord
acts_as_voter
end
To get all upvoted posts of some user (e.g. current_user
)
current_user.get_up_voted(Post)
Please also look at the docs