Best way to load module/class from lib folder in Rails 3? -
Since the latest rail 3 release auto-loading modules and sections do not come from lib, the best way to load What will happen to them
From github:
Some changes were made to this commitment: do not automatically load the code in * lib * for applications It requires them to require it) It treats an app close to an engine (code in Lib is still autoloaded for plug-in);
, config / application has a setting in Rb wherein you can specify directories that contain the files that you want to auto-load.
From the application.rb:
Custom directories with # class and module you want automatically loadable # Config.autoload_paths + =% W (# { Config.root} / extras)
Comments
Post a Comment