6

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.

Nick Faraday
  • 598
  • 5
  • 23
  • check this: [http://stackoverflow.com/questions/885277/how-to-implement-an-achievement-system-in-ror](http://stackoverflow.com/questions/885277/how-to-implement-an-achievement-system-in-ror) – airy Nov 30 '09 at 07:31

4 Answers4

7

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

Community
  • 1
  • 1
Jack Hoge
  • 613
  • 2
  • 8
  • 9
  • This is kind of an old question and I ended up rolling my own solution, but this is what I was looking for at the time so I will mark this as the answer! – Nick Faraday Jun 03 '11 at 23:49
1

check out https://github.com/paulca/paths_of_glory

Roger
  • 302
  • 1
  • 8
0

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.

Javier
  • 2,491
  • 4
  • 36
  • 57
0

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

knappen
  • 462
  • 3
  • 7