[英]how to get all the posts upvoted be current user using acts_as_votable gem
我想显示用户投票的所有帖子,我该怎么做。
假设你有这样的模型
class Post < ApplicationRecord
acts_as_votable
end
class User < ApplicationRecord
acts_as_voter
end
获取某个用户(例如current_user
)的所有赞成的帖子
current_user.get_up_voted(Post)
另请查看文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.