blog.robotex.de

Rails3: Autoloading /lib with all subdirs

Edit your Rails.root/config/application.rb:

module YourApplication
  class Application < Rails::Application
    .
    .
    .
    config.autoload_paths += %W(#{config.root}/lib)
    config.autoload_paths += Dir["#{config.root}/lib/**/"]
    .
    .
    .
  end
eend


Back