Tuesday, March 15, 2011

What is the earliest callback one can hook in the Rails Framework?

I have found the before_dispatch and after_dispatch in dispatcher.rb but I need to access something earlier. Like around when Rails.public_path is defined.

From stackoverflow
  • If it's needed for Mongrel or Apache, are You sure it can not be done by configuration?

  • Not sure what you're trying to do, but you can take a look at config/boot.rb (don't change it please). In there, you'll find it will load the file config/preinitializer.rb if it exists. That might be overkill though, you probably can do what you want by creating an initializer in config/initializers/.

0 comments:

Post a Comment