Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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.

There is also Gioco, which I haven't yet tried: http://joaomdmoura.github.io/gioco/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top