Tag: 装载

Rails 3.2.9和子文件夹中的模型

由于rails 3.2.9我无法在子文件夹中存储模型。 在我的应用程序中,我有这棵树: models -type_models -assets -user -concerns 同样在application.rb中 config.autoload_paths += Dir[“#{config.root}/app/models/*”] 所有事情都没问题,直到3.2.9。 现在我有“未知常量”错误。 我不想命名大量模型并修复所有应用程序以使用命名空间模型。 Warning: Error loading /var/www/my_app/app/models/type_models/context_type.rb: uninitialized constant TypeModels::ContextType file context_type.rb: class ContextType … end