No description, website, or topics provided.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
generators/count_migration
lib
tasks
test
MIT-LICENSE
README.textile
Rakefile
init.rb

README.textile

Count Von Count

Disclaimer

The code in here still needs lots of love.

Installation

script/plugin install git://github.com/toastyapps/count_von_count.git
script/generate count_migration
rake db:migrate

Usage

From inside your controller action you may now do

@post = Post.find(params[:id])
@post.update_view_count(request)

You also get a view_count helper method
@post.view_count # 10

If you want to store the total view count on the model add a field called “total_view_count” to your model

You may also add IP addresses to a blacklist so that they are not recorded by adding this to an initializer
CountVonCount.blacklist = %w{127.0.0.1}