开发者

Rails in which folder should ruby classes go into?

开发者 https://www.devze.com 2023-02-26 02:09 出处:网络
Ra开发者_运维百科ils in which folder should ruby classes go into? I am reading this guide and I am wondering in which folder the NewsletterJob class should be in. If you use the lib folder in rails

Ra开发者_运维百科ils in which folder should ruby classes go into?

I am reading this guide and I am wondering in which folder the NewsletterJob class should be in.


If you use the lib folder in rails 3, you need to add that to the load path, as rails 3 removed it by default:

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


You can put them in the lib folder. Or maybe add a folder under app, like jobs and you should get it loaded automatically in your environment.

0

精彩评论

暂无评论...
验证码 换一张
取 消