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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On 4/11/07, Pedro Cardoso <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > 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 > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yes, that''s a fact... Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---