【发布时间】:2011-08-02 13:05:23
【问题描述】:
我想在我的应用程序中使用 token_authenticable(使用 Devise)。
使用this 答案我在文件app/controllers/users_sessions_controller.rb 中添加了class Users::SessionsController(文件位置是否正确?)。
为了在数据库中生成 authentication_token,我添加了行 current_user.reset_authentication_token! 作为 create 方法的第四行。
使用devise docimentation 中的“配置控制器”部分,我在路由中添加了行devise_for :users, :controllers => {:sessions => "users/sessions"}。
我还有文件app/views/users/session/new.html.erb。
现在,当我尝试在浏览器中登录或注销时,我得到Routing Error uninitialized constant Users。
我不知道会发生什么。我想我把控制器类命名错了,或者放错了,但不确定。
【问题讨论】:
标签: ruby-on-rails-3 routing devise