Tag: 表现为可投票的

检查用户是否已使用范围投票

我使用行为投票来实施网络民意调查。 通过两种选择,可以很容易地确定用户是否已投票。 @user.likes @comment1 @user.up_votes @comment2 # user has not voted on @comment3 @user.voted_for? @comment1 # => true @user.voted_for? @comment2 # => true @user.voted_for? @comment3 # => false @user.voted_as_when_voted_for @comment1 # => true, user liked it @user.voted_as_when_voted_for @comment2 # => false, user didnt like it @user.voted_as_when_voted_for @comment3 # => nil, user has yet to vote […]