Observers, environment.rb and application.rb

Hi.

I’m running some tests with Observers and I’m having trouble making them
work.

I’ve tried to follow the code that’s on the API, but that does not work.

I’ve name my Observer after a model, as said, and added it in
environment.rb. That does not work. I had to had it in application.rb,
like observer :my_observer to make it work. My problem is that that’s
not very elegant…

Any ideas?

Thanks
JotaPe

I’d guess you are running Rails 1.1.6 or earlier. Newer versions of
Rails
properly use the environment.rb for setting observers and have removed
the
ActionController::Base#observer call.

Jason

Yes, that’s a fact…

Thanks