简体   繁体   中英

Autoloading files in subfolders to helpers

I want to organize some helpers in subfolders in the helpers directory. I figured adding this in the initializer would do the trick, but not luck:

  config.autoload_paths += Dir["#{RAILS_ROOT}/app/helpers/*"].find_all { |f| File.stat(f).directory? }

您只需将其添加到application.rb文件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM