Ruby on rails 3 Rails 3 RESTful身份验证-未初始化常量ApplicationController::AuthenticatedSystem
刚从安装了升级的Rails 3 restful_认证插件。我正在尝试将插件中的代码包括在我的应用程序助手中,如下所示:Ruby on rails 3 Rails 3 RESTful身份验证-未初始化常量ApplicationController::AuthenticatedSystem,ruby-on-rails-3,restful-authentication,Ruby On Rails 3,Restful Authentication,刚从安装了升级的Rails 3 restful_认证插件。我正在尝试将插件中的代码包括在我的应用程序助手中,如下所示: class ApplicationController < ActionController::Base protect_from_forgery include AuthenticatedSystem end uninitialized constant ApplicationHelper::AuthenticatedSystem Authenti
class ApplicationController < ActionController::Base
protect_from_forgery
include AuthenticatedSystem
end
uninitialized constant ApplicationHelper::AuthenticatedSystem
AuthenticatedSystem是lib/authenticated_system.rb中的一个模块,那么为什么include不能工作?Rails 3默认情况下不再加载/lib目录中的文件:( 将此添加到config/application.rb:
config.autoload_paths << "#{Rails.root}/lib"
config.autoload\u路径谢谢,效果很好!知道为什么默认不再包含它的原因吗?谢谢我所需要的。