Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A rails plugin that allows you to create extensible log of activity
Branch: master
Pull request Compare This branch is 27 commits behind parolkar:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.



You need Pfeed when you want to automagically create fancy logs / activity updates in your rails app.

What's so magical here?

Lets assume you have a model that looks like

 class User < ActiveRecord::Base
   has_many :friends
   has_one  :company
   def buy(x)

   def sell(x)
   def find_friends

Now lets add two lines at bottom of model definition

 emits_pfeeds :on => [:buy,:sell,:find_friends,:update_attribute] , :for => [:itself ,:all_in_its_class, :friends]

And you perform regular operations, like this

 u1 = User.first
 u2 = User.last
 list = u2.find_friends
 u2.update_attribute(:nick_name, "alice") (1)

your application now emits feed without any other additional piece of code, and feed will look like this in view.

 parolkar sold item about 6 minutes ago
 parolkar bought item about 4 minutes ago
 foo found friends about 2 minutes ago
 foo updated attribute nick name about 2 minutes ago
 alice bought item about 2 minutes ago
Isn't it magical? that it guesses the identity of model object (parolkar or foo in this case) and methods being called are treated as verbs to form a simple past tense. Even more, each feed can be customized and skinned the way you want. You can easily extend the functionality to suit your requirements. If all this excites you, check out the tutorials [here]( "pfeed's Wiki") ## More Details *What is feed?* Feed is the collection of activity logs which is generated while you perform actions on model objects. *Whats so special?, Why should I bother about it?* Imagine you want to create admin console for your app to monitor functional activities in your web apps ,i.e how users are using different parts of application. You will need to think of mechanism to capture the logs and then display in some logical manner. OR Imagine you are building an app like facebook and you want to capture all activity user is performing and display it to her friends/group member/admin , Its a whole new feature whose implementation will force you to dig into design of your app and see where all the logs get generated and then to whom all the logs are going to be published. What if I give you a generalized information model which will allow you to create such feature by keeping it completely isolated from your existing logic? and What if it is really scalable enough? (more content to come here...) ## Installation
 $ script/plugin install git://
 $ rake pfeed:setup 

Copyright (c) 2009 [Abhishek Parolkar] abhishek[at] , released under the MIT license

Something went wrong with that request. Please try again.