铁轨“徽章” 输入插件/教程?
有谁知道是否有 Rails gem/插件/教程,展示如何创建类似于 stackoverflow 使用的徽章/成就系统。
谢谢。
Does anyone know if there is a Rails gem/plugin/tutorial that shows how to create a Badge/Achievement system similar to what stackoverflow uses.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可能还想尝试成就 gem:https://github.com/mrb/achievements
基于 Redis,因此您需要首先使其正常工作。 基本上,您可以定义一堆成就上下文(查看的页面、发送的消息等)以及多个级别(如果需要)。 然后,您可以根据某些事件适当增加您的价值,然后您可以检查是否已达到成就。
此链接还对徽章/成就系统背后的思想进行了相对详细的解释: RoR成就系统-多态关联& 设计问题
You might also want to try the achievements gem: https://github.com/mrb/achievements
It's based on Redis, so you'll need to get that working first. Basically, you define a bunch of achievement contexts (pages viewed, messages sent, etc.) along with multiple levels if necessary. Then, you increment your value appropriately upon certain events, and you can then check if the achievement has been reached.
This link also has a relatively detailed explanation of the thinking behind a badge/achievement system: RoR Achievement System - Polymorphic Association & Design Issues
查看 https://github.com/paulca/paths_of_glory
check out https://github.com/paulca/paths_of_glory
我认为这不是一个框架,而是一个设计问题。 如果您知道如何以面向对象的方式构建它,您最终也会知道如何在 Rails 中构建它。
如果您是 Rails 新手,请查看有关“Active Record Associations”的 Rails 指南尝试识别“徽章/成就系统”的模型和关联。
除此之外:不,我不知道有任何交钥匙宝石/插件/教程可以帮助您构建这样的系统。
I think it's less a framework but a design question. If you know how to build it in an object-oriented way, you'll eventually know how to build it in Rails too.
If you're a Rails newbie, check out the Rails Guide on "Active Record Associations" and try to identify the models and the associations of your "badge/achievment system".
Besides that: No, I don't know of any turnkey-gem/plugin/tutorial that would help you build such a system.
还有Gioco,我还没尝试过:
http://joaomdmoura.github.io/gioco/
There is also Gioco, which I haven't yet tried:
http://joaomdmoura.github.io/gioco/