0

我正在尝试使用一个非常简单的测试项目DeviseHighVoltage在开发rails server中运行 HighVoltage 工作正常,但是,在生产中运行的远程服务器上,使用passenger相同的 url 重定向到登录屏幕。

这是代码:

class ApplicationController < ActionController::Base
  before_action :authenticate_user!, except: ['home']


class PagesController < HighVoltage::PagesController
    skip_filter :authenticate_user!

I, [2015-11-10T23:57:21.491566 #27644]  INFO -- : Processing by HighVoltage::PagesController#show as HTML
I, [2015-11-10T23:57:21.491656 #27644]  INFO -- :   Parameters: {"id"=>"testpage"}
I, [2015-11-10T23:57:21.500450 #27644]  INFO -- : Completed 401 Unauthorized in 9ms (ActiveRecord: 0.0ms)

可能是什么原因?一个版本和另一个版本之间的代码没有变化,而且 gem 是相同的。我测试了删除 before_action 并且效果很好。所以这让我觉得问题在于 skip_filter 方法不起作用。

4

0 回答 0