/ Published in: Ruby
Rails builds on the standard Ruby observer, so you can too.
Originally found at http://rails.techno-weenie.net/forums/1/topics/672?page=6,
so don't give me any credit ;)
Originally found at http://rails.techno-weenie.net/forums/1/topics/672?page=6,
so don't give me any credit ;)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
def my_method! #- Your Method Code Here -# self.class.changed self.class.notify_observers(:my_method, self) end That will call any observers 'my_method' method.