相关疑难解决方法(0)

在Rails 3中从lib文件夹加载模块/类的最佳方法?

由于最新的Rails 3版本不再自动加载来自lib的模块和类,加载它们的最佳方法是什么?

来自github:

A few changes were done in this commit:

Do not autoload code in *lib* for applications (now you need to explicitly 
require them). This makes an application behave closer to an engine 
(code in lib is still autoloaded for plugins);
Run Code Online (Sandbox Code Playgroud)

module ruby-on-rails class autoload ruby-on-rails-3

271
推荐指数
9
解决办法
13万
查看次数

标签 统计

autoload ×1

class ×1

module ×1

ruby-on-rails ×1

ruby-on-rails-3 ×1