开发者

Autoload plugins folder in Rails 3?

The methods in the last two rows in the block are removed in Rails 3.

%w{ models controllers }.each do |dir|
  path = File.join(File.dirname(__FILE__), 'app', dir)
  $LOAD_PATH << path
  ActiveSupport::Dependencies.load path
  ActiveSupport::Dependencies.load_once_paths.delete(path)
end

I wonder how you could autoload the files in the plugins models and controllers folder开发者_开发技巧?


load_paths and load_once_paths were renamed in Rails 3 :

ActiveSupport::Dependencies.autoload_paths
ActiveSupport::Dependencies.autoload_once_paths
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜