【发布时间】:2014-01-08 21:32:11
【问题描述】:
我有一个功能齐全的带有 MySQL 的 Rails 3.2 应用程序,我正在尝试转换为 MongoDB。我认为这将是一个简单的转换,但在我的application.html.erb 模板中,我引用了current_user,我得到了这个错误:
undefined local variable or method `current_user' for #<#<Class:0x007f98674f58d8>:0x007f9867358840>
知道为什么会失败吗?
谢谢, 凯文
【问题讨论】:
-
你能把 current_user 代码贴在你的 application.html.erb 和 ApplicationController 中吗?切换到 MongoDB 应该不会影响这一点。另请参阅此 QA stackoverflow.com/questions/19147729/…
标签: ruby-on-rails mongodb devise