0

My Rails app creates a handful of very simple "landing pages" and I'd like to know when a visitor comes to the web page with a "view counter."

Are there a recommended gem, plugin, or maybe some code someone can send to me to help me?

Thank you.

Satchel
  • 16,414
  • 23
  • 106
  • 192

3 Answers3

1

RailsStats should be compatible with 2.3.x

Mike Lewis
  • 63,433
  • 20
  • 141
  • 111
1

I would suggest with redis. It's perfect for realtime stats. It gives you the speed and atomic increments that you want, plus it persists.

If you dont want to rely on external things then try this link.
simple hit counter for page views in rails

Community
  • 1
  • 1
Ashish
  • 5,723
  • 2
  • 24
  • 25
  • I think the advice in the answer to that linked SO question is pretty solid -> roll your own, probably less work. You could even do it as a before_filter in your application controller – Toby Hede Mar 14 '11 at 06:01
  • @Toby and @Ashish -- how would this roll your own differ from using the plugin below acts_as_viewable – Satchel Mar 15 '11 at 20:42
  • You would build only what you actually need and not need external code. If the plugin works for you, use it. – Toby Hede Mar 15 '11 at 23:35
0

Try this plugin .. https://github.com/iorum-ie/acts_as_viewable

It actually checks IP address so visits from the same IP won't be recounted within a period of time.

lulalala
  • 17,572
  • 15
  • 110
  • 169
krunal shah
  • 16,089
  • 25
  • 97
  • 143