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
?