Forum: Ruby on Rails Observable notifying a controller.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Fernando L. (Guest)
on 2006-06-08 18:47
(Received via mailing list)
I want to code the following task:

I have a class, for instance, class A with is a observable.

I want to add a controller of my rails system to this class. So I can
notify_observer, and it updates all controllers of my system.

How do I pass a controller as a parameter to the add_observer() method?
And where I put this code?

Thanks in advance.

Fernando L.
Fernando L. (Guest)
on 2006-06-08 21:35
(Received via mailing list)
Fernando L. wrote:
To develop a chat application I have a external class that notify every
user in the chat about a new conversation.
I'm using observer pattern. Now, I want to create a controller in my
rails app. And notify this controller to change the view when it
receives a new action.

How could I implement this?

I need to pass a instance of my classto the controller initialize

def initialize(observable)

Where I initialize this instance of my class?

Thanks in advance.

Fernando L.
This topic is locked and can not be replied to.