public Method

ClassMethods.find_filter(filter) { |f| ... }

Find a filter in the filter_chain where the filter method matches the filter param and (optionally) the passed block evaluates to true (mostly used for testing before? and after? on the filter). Useful for symbol filters.

The object of type Filter is passed to the block when yielded, not the filter itself.

Source Code

# File action_controller/filters.rb, line 378
def find_filter(filter, &block) #:nodoc:
  filter_chain.select { |f| f.filter == filter && (!block_given? || yield(f)) }.first
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.