【文件属性】:
文件名称:mongoid_vote:mongoid 的投票宝石
文件大小:4KB
文件格式:ZIP
更新时间:2021-06-21 17:42:59
Ruby
Mongoid票
为 Mongoid 文档添加投票功能的基本 gem。 将适用于嵌入式文档。
安装
导轨3 x和上述
要安装 gem,请将其添加到您的 Gemfile 中:
gem 'mongoid_vote'
跑步:
bundle install
然后将其添加到您想要添加投票功能的文档模型中:
include MongoidVote :: Voteable
用法示例
@comment . upvote ( @user ) # up vote
@comment . downvote ( @user ) # down vote
@comment . upvote_toggle ( @user ) # acts as upvote / if up vote already present, removes vote instead. (i
【文件预览】:
mongoid_vote-master
----Rakefile(28B)
----readme.rdoc(1KB)
----.DS_Store(6KB)
----Gemfile(96B)
----.gitignore(33B)
----lib()
--------mongoid_vote()
--------mongoid_vote.rb(62B)
----mongoid_vote.gemspec(742B)