If you refer http://api.rubyonrails.org/v2.3.8/classes/ActionController/Filters/ClassMethods.html, there is a subheading called “Filter chain ordering”, here is the example code from that:
class ShoppingController < ActionController::Base
before_filter :verify_open_shop
class CheckoutController < ShoppingController
prepend_before_filter :ensure_items_in_cart, :ensure_items_in_stock
According to the explanation:
The filter chain for the
CheckoutControlleris now
:ensure_items_in_cart,:ensure_items_in_stock,
:verify_open_shop.
So you can explicitly give the order of the filter chain like that.