# Simple Activity Stream

**URL:** <https://www.ruby-forum.com/t/simple-activity-stream/179543>\
**Category:** Rails\
**Created:** [November 27, 2009, 10:49pm UTC](https://www.ruby-forum.com/t/simple-activity-stream/179543 "2009-11-27T22:49:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdmcnitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a4c791/32.png) [@bdmcnitt](https://www.ruby-forum.com/u/bdmcnitt)\
**Post date:** [November 27, 2009, 10:49pm UTC](https://www.ruby-forum.com/t/simple-activity-stream/179543/1 "2009-11-27T22:49:43Z")

</div>

Hey all,  
I was wondering if anyone in here has an easy way to make a simple  
activity stream. I understand the concepts around it, but haven’t been  
able to get my code right. From what I understand, all the stream is a  
separate table that gets populated with entries when given events  
happen, say you login, or you follow someone.

If I have an events controller with the create action in it, should I  
just call it from other controllers? For example, If I create a new  
user, in the create action for the user controller would I also stick in  
the code for the create action in the events controller? This seems  
logical, but doesn’t seem like the appropriate way to do it.

Let me know what you think, any information would be helpful, thanks!

-Brian

---

<div class="post-metadata">

**Author:** ![bdmcnitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a4c791/32.png) [@bdmcnitt](https://www.ruby-forum.com/u/bdmcnitt)\
**Post date:** [November 27, 2009, 11:09pm UTC](https://www.ruby-forum.com/t/simple-activity-stream/179543/2 "2009-11-27T23:09:38Z")

</div>

Brian Michel wrote:  
[…]

> If I have an events controller with the create action in it, should I  
> just call it from other controllers? For example, If I create a new  
> user, in the create action for the user controller would I also stick in  
> the code for the create action in the events controller? This seems  
> logical, but doesn’t seem like the appropriate way to do it.

Why not use an observer?

> Let me know what you think, any information would be helpful, thanks!
> 
> -Brian

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![bdmcnitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a4c791/32.png) [@bdmcnitt](https://www.ruby-forum.com/u/bdmcnitt)\
**Post date:** [November 27, 2009, 11:11pm UTC](https://www.ruby-forum.com/t/simple-activity-stream/179543/3 "2009-11-27T23:11:01Z")

</div>

Marnen Laibow-Koser wrote:

> Brian Michel wrote:  
> […]
> 
> > If I have an events controller with the create action in it, should I  
> > just call it from other controllers? For example, If I create a new  
> > user, in the create action for the user controller would I also stick in  
> > the code for the create action in the events controller? This seems  
> > logical, but doesn’t seem like the appropriate way to do it.
> 
> Why not use an observer?
> 
> > Let me know what you think, any information would be helpful, thanks!
> > 
> > -Brian
> 
> ## Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> removed\_email\_address@domain.invalid

Marnen,  
Would you please care to elaborate a little bit?

-Brian

---

<div class="post-metadata">

**Author:** ![bdmcnitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a4c791/32.png) [@bdmcnitt](https://www.ruby-forum.com/u/bdmcnitt)\
**Post date:** [November 27, 2009, 11:15pm UTC](https://www.ruby-forum.com/t/simple-activity-stream/179543/4 "2009-11-27T23:15:51Z")

</div>

Brian Michel wrote:

> Marnen Laibow-Koser wrote:
> 
> > Brian Michel wrote:  
> > […]
> > 
> > > If I have an events controller with the create action in it, should I  
> > > just call it from other controllers? For example, If I create a new  
> > > user, in the create action for the user controller would I also stick in  
> > > the code for the create action in the events controller? This seems  
> > > logical, but doesn’t seem like the appropriate way to do it.
> > 
> > Why not use an observer?
> > 
> > > Let me know what you think, any information would be helpful, thanks!
> > > 
> > > -Brian
> > 
> > ## Best,
> > 
> > Marnen Laibow-Koser  
> > [http://www.marnen.org](http://www.marnen.org)  
> > removed\_email\_address@domain.invalid
> 
> Marnen,  
> Would you please care to elaborate a little bit?

What part don’t you understand? Have you read the docs on observers in  
Rails?

> -Brian

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
