Rails外如何启动rails的类自动加载_activates autoloading using ActiveSupport 3.x

 

 

 

 

The following code activates autoloading using ActiveSupport 3.x:

require 'active_support'
require 'active_support/dependencies'
relative_load_paths = %w[app/controllers app/models]
ActiveSupport::Dependencies.autoload_paths += relative_load_paths

prefer: http://makandracards.com/makandra/8879-use-activesupport-autoloading-outside-of-rails 

 

 

+

+

+

=

)

)

)

 

你可能感兴趣的:(Rails外如何启动rails的类自动加载_activates autoloading using ActiveSupport 3.x)