📜  自动加载路径导轨 - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:46.449000             🧑  作者: Mango

代码示例1
# config/application.rb
config.autoload_paths << Rails.root.join('lib')
# or
config.autoload_paths += %W( 
  #{config.root}/...
  #{config.root}/...
  #{config.root}/...
) # that’s why concerns (model/controller) do not have Concern as namespace

# to check paths loaded
puts ActiveSupport::Dependencies.autoload_paths