I''m begining whith rails. In the rails directory structure, where is the nicest directory tu put my active record callback objects ? app/helpers ? app/models ? lib ? May looks a stupid questions but i can''t find answers googling.
On Thu, Jun 11, 2009 at 5:07 AM, jclagache<jclagache@gmail.com> wrote:> > I''m begining whith rails. > In the rails directory structure, where is the nicest directory tu put > my active record callback objects ? > app/helpers ? > app/models ? > lib ? > > May looks a stupid questions but i can''t find answers googling.I put my observer classes in app/models. jeremy
On Jun 11, 3:07 pm, jclagache <jclaga...@gmail.com> wrote:> I''m begining whith rails. > In the rails directory structure, where is the nicest directory tu put > my active record callback objects ? > app/helpers ? > app/models ? > lib ?I keep my observers in app/observers. Feels cleaner to me. For it to work, add that directory to load path in environment.rb: config.load_paths << "#{RAILS_ROOT}/app/observers"
Thanks for your replies. I undestand that there is not a rails defined directory to put the callbacks/observers objects. As my callback only depends on the model stack, i put it in a new directory : app/models/callbacks. Works fine and seems nice for me.