Translate

January 9, 2014

What are filters? and how many types of filters are there in ruby?

Filters are methods that are run before, after or "around" a controller action.

Filters are inherited, so if you set a filter on ApplicationController, it will be run on every controller in your application.

Filter can take one of three forms: method reference (symbol), external class, or inline method (proc).

          after_filter
    append_after_filter
    append_around_filter
    append_before_filter
    around_filter
    before_filter
    filter_chain
    prepend_after_filter
    prepend_around_filter
    prepend_before_filter
    skip_after_filter
    skip_before_filter
    skip_filter

No comments: