What better ways to pass arguments to filters in Rails controllers?
EDIT: The filter has a different behavior depending on the parameters passed to it, or depends on the parameters to perform its action.
I have an example in my app, where a filter determines how the data is sorted. This filter has a klass param and calls klass.set_filter(param[:order]) to determine :order in the search.
You have to use procs for this.
Edit
One more way to pass the parameter is to override the
callmethod ofActionController::Filters::BeforeFilter.Now you can change your before_filter specification as follows