2010-08-02 62 views

回答

26

據我所知,這是解決類繼承,你不能定義的before_filter的順序:

ApplicationController < ActionController::Base  
    before_filter :do_this_first  
    #.... 
end 

SomeController < ApplicationController  
    before_filter :do_this_second 
    #.... 
end 

在這裏,既沒有定義,除非您使用prepend_before_filter將有偏好的方法。

0

看起來像prepend_filter,在隊列before_filter s,它在隊列前面添加一個過濾器。因此,最後到來,首先服務。