我在控制器中有一些行为,我把它们拉到一个模块中,以便更好地测试并在一些地方重用它。关于此,有两个问题:
- Where is a good place to put my modules? They need to run in order to be available to the controllers, so I was thinking the
config/initializers/
directory. That seems a little suspect to me though.lib/
? - How do I ensure the code gets run so the modules are available to
include
in my controllers?
谢谢各位。