Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

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
Source by til.hashrocket.com #
 
PREVIOUS NEXT
Tagged: #auto #load #path #rails
ADD COMMENT
Topic
Name
8+2 =