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 

+

+

+

扫描二维码关注公众号,回复: 622130 查看本文章

=

)

)

)

猜你喜欢

转载自fantaxy025025.iteye.com/blog/2112209
今日推荐