Insallation +++++++++++++

sudo gem install acts_as_viewable

Post Installation (Rails)


  1. script/generate acts_as_viewable_on_migration

  2. rake db:migrate

Example

class Property < ActiveRecord::Base

acts_as_viewable_on  :authorized, :unuthorized, :managers

end

@property = Property.new(:name => “Bobby”) @property.increase_views_on_managers @property.views_on_manager # => 1 @property.views_on_authorized # => 0 @property.events_on_managers # => => “12.23.2009” , :ip => ‘192.168.1.1’ , :user_agent => ‘agent’ , :os => ‘Windows’