1
我的应用程序控制器看起来像这样为什么before_filter没有像我期望的那样使用restful-authentication?
class ApplicationController < ActionController::Base
include AuthenticatedSystem
helper :all # include all helpers, all the time
protect_from_forgery # :secret => 'sup3rs3cr3t'
filter_parameter_logging :password
# Here's the interesting bit
before_filter :login_required, :except => [:index, :show, :new]
end
现在我还有一个控制器,它看起来像这样
class CompletelySecretController < ApplicationController
# the other interesting bit
before_filter :login_required
def index
@secrets = Secret.find(:all)
end
end
我仍然可以看到所有的秘密,尽管我指出一个需要登录的所有与
before_filter :login_required
行为难道不是直观认为子类中的将覆盖父类中的before_filter
?