Application.rb and before_filter

Hello,

How can i apply a before_filter on all controllers in application.rb
without some specific controllers. Is there something like :only and
:except for controllers like there is for methods?

Hi,

Pawel Jur wrote:

How can i apply a before_filter on all controllers in application.rb
without some specific controllers. Is there something like :only and
:except for controllers like there is for methods?

You can use skip_after_filter, skip_before_filter, or skip_filter to
skip filters in a controller.

http://api.rubyonrails.com/classes/ActionController/Filters/ClassMethods.html

Lutz

Lutz H. wrote:

Hi,

Pawel Jur wrote:

How can i apply a before_filter on all controllers in application.rb
without some specific controllers. Is there something like :only and
:except for controllers like there is for methods?

You can use skip_after_filter, skip_before_filter, or skip_filter to
skip filters in a controller.

Peak Obsession

Lutz

Wow, skip_filter … nice! :slight_smile:

thanks. just what i was looking for.