Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/57.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 Authlogic和acts作为真实问题_Ruby On Rails_Ruby_Authentication - Fatal编程技术网

Ruby on rails Authlogic和acts作为真实问题

Ruby on rails Authlogic和acts作为真实问题,ruby-on-rails,ruby,authentication,Ruby On Rails,Ruby,Authentication,我们正在使用authlogic对我的用户进行身份验证。它在其他机器上工作,但我得到了错误 提取的源(第20行附近): 7:'Home',:class=>'标题徽标'%> 18: 19: 20: 21: 22::delete,:confirm=>“您确定要注销吗?”%> 23: app/models/user.rb:2:in'acts\u as\u authentic' app/models/user.rb:2 app/cont

我们正在使用authlogic对我的用户进行身份验证。它在其他机器上工作,但我得到了错误

提取的源(第20行附近):

7:'Home',:class=>'标题徽标'%>
18: 
19: 
20:         
21:             
22::delete,:confirm=>“您确定要注销吗?”%>
23:           
app/models/user.rb:2:in'acts\u as\u authentic'
app/models/user.rb:2
app/controllers/application.rb:17:在“当前用户会话”中
app/controllers/application.rb:22:在“当前用户”中
(eval):2:在'send'中
(评估):2:在“当前用户”中
app/views/layouts/application.html.erb:20

建议我怎么做???

Authlogic不提供当前用户功能。您必须确保在应用程序控制器中提供它

下面的示例非常简单()。Authlogic是有更好的文档记录的宝石之一


另外,Google Group()非常活跃,响应速度也非常快。你在那里可能会更走运。

在那条线上应该有一个错误。。请粘贴完整的堆栈跟踪。
7:         <%= link_to "Home", "/", :title => 'Home', :class => 'header-logo' %>
18: 
19: 
20:        <span style="padding-left:850px;"> <% if current_user %>
21:             <%= link_to "My Account", account_path %>
22:             <%= link_to 'logout', logout_path, :method => :delete, :confirm => "Are you sure you want to logout?" %>
23:           <%elsif !current_user%>



app/models/user.rb:2:in `acts_as_authentic'
app/models/user.rb:2
app/controllers/application.rb:17:in `current_user_session'
app/controllers/application.rb:22:in `current_user'
(eval):2:in `send'
(eval):2:in `current_user'
app/views/layouts/application.html.erb:20