On Apr 26, 2006, at 3:09 PM, Jose Hales-Garcia wrote:
What is the difference between these two? Also, is it necessary to
in the observer class the following?
Don’t go the controller route… that doesn’t really work when you’re
doing stuff that isn’t through your controllers.
I posted about this a while back on my blog:
You can do the following:
- create the observer:
class CustomObserver < ActiveRecord::Observer
showing how you can use Camel or symbols
observe Contact, :contact_note
def after_create( object )
# do something… with object
- Modify config/environment.rb
config.active_record.observers = :custom_observer
- have fun!
Hope that helps!
Founder & Executive Director
PLANET ARGON, LLC
Ruby on Rails Development, Consulting & Hosting
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4968 [fax]