加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails-3 – Rails 3 RESTful身份验证 – 未初始化的常量

发布时间:2020-12-16 22:27:48 所属栏目:百科 来源:网络整理
导读:刚刚从 https://github.com/Satish/restful-authentication安装了升级的Rails 3的restful_authentication插件.我正在尝试从我的应用程序助手中插入代码,如下所示: class ApplicationController ActionController::Base protect_from_forgery include Authen
刚刚从 https://github.com/Satish/restful-authentication安装了升级的Rails 3的restful_authentication插件.我正在尝试从我的应用程序助手中插入代码,如下所示:
class ApplicationController < ActionController::Base
    protect_from_forgery

    include AuthenticatedSystem
end

但是,当我运行服务器并导航到本地主机上的应用程序时,我会收到如下错误:

uninitialized constant ApplicationHelper::AuthenticatedSystem

AuthenticatedSystem是lib / authenticated_system.rb中的一个模块,所以为什么不包括工作?

解决方法

默认情况下,Rails 3不会在/ lib目录中加载文件:(

将其添加到您的config / application.rb中:

config.autoload_paths << "#{Rails.root}/lib"

你应该没事不要忘记重新启动服务器.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读