Best way to load module/class from lib folder in Rails 3?

后端 未结 12 1909
别跟我提以往
别跟我提以往 2020-11-22 11:56

Since the latest Rails 3 release is not auto-loading modules and classes from lib anymore, what would be the best way to load them?

From github:

12条回答
  •  情深已故
    2020-11-22 12:32

    As of Rails 2.3.9, there is a setting in config/application.rb in which you can specify directories that contain files you want autoloaded.

    From application.rb:

    # Custom directories with classes and modules you want to be autoloadable.
    # config.autoload_paths += %W(#{config.root}/extras)
    

提交回复
热议问题