开发者

Rails 3 RESTful Authentication - uninitialized constant ApplicationController::AuthenticatedSystem

开发者 https://www.devze.com 2023-04-07 03:34 出处:网络
Just installed the upgraded restful_authentication plugin for Rails 3 from https://github.com/Satish/restful-authentication. I\'m trying to include code from the plugin in my application helper as fol

Just installed the upgraded restful_authentication plugin for Rails 3 from https://github.com/Satish/restful-authentication. I'm trying to include code from the plugin in my application helper as follows:

class ApplicationController < ActionController::Base
    protect_from_forgery

    include AuthenticatedSystem开发者_运维百科
end

However, when I run the server and navigate to my application on the localhost, I get an error as follows:

uninitialized constant ApplicationHelper::AuthenticatedSystem

AuthenticatedSystem is a module in lib/authenticated_system.rb, so why isn't the include working?


Rails 3 doesn't load files in the /lib directory by default anymore :(

Add this to your config/application.rb:

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

And you should be fine. Don't forget to restart your server.

0

精彩评论

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