Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 3 Rails 3 RESTful身份验证-未初始化常量ApplicationController::AuthenticatedSystem_Ruby On Rails 3_Restful Authentication - Fatal编程技术网

Ruby on rails 3 Rails 3 RESTful身份验证-未初始化常量ApplicationController::AuthenticatedSystem

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

刚从安装了升级的Rails 3 restful_认证插件。我正在尝试将插件中的代码包括在我的应用程序助手中,如下所示:

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路径谢谢,效果很好!知道为什么默认不再包含它的原因吗?谢谢我所需要的。