Answers for "rails add autoload path"

0

auto load path rails

# 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
Posted by: Guest on October-29-2021

Browse Popular Code Answers by Language