开发者

Autoloading files in subfolders to helpers

开发者 https://www.devze.com 2023-04-04 15:40 出处:网络
I want to organize some helpers in subfolders in the helpers开发者_如何学Python directory.I figured adding this in the initializer would do the trick, but not luck:

I want to organize some helpers in subfolders in the helpers开发者_如何学Python 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? }


You should simply add this to your application.rb file.

0

精彩评论

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