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

后端 未结 12 1910
别跟我提以往
别跟我提以往 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条回答
  •  旧时难觅i
    2020-11-22 12:29

    Very similar, but I think this is a little more elegant:

    config.autoload_paths += Dir["#{config.root}/lib", "#{config.root}/lib/**/"]
    

提交回复
热议问题