Excluding controller from before_filter

hi

my app uses before_filter for authorization in ApplicationController which filter 'create', 'update' and so on in every controller. But let's say i want to exclude 'create' in one particular controller how would i do this best. I'm missing something like :

class ApplicationController before_filter check_permission , :exclude => [MailerController::create] ...

hi

my app uses before_filter for authorization in ApplicationController

which filter ‘create’, ‘update’ and so on in every controller. But

let’s say i want to exclude ‘create’ in one particular controller how

would i do this best.

I’m missing something like :

class ApplicationController

before_filter check_permission , :exclude =>

[MailerController::create]

Hi, you can do the following:

before_filter :check_permission, :except => :create

Good luck,

-Conrad

This would exclude all create methods in all controllers which is exactly the the opposite i need. is using skip_before_filter the rails way to exclude before_filter for a certain controller?

Or use skip_before_filter in that controller, as you can clearly find in the API documentation: http://api.rubyonrails.org/classes/ActionController/Filters/ClassMethods.html (Filter chain skipping).

Best regards

Peter De Berdt

This would exclude all create methods in all controllers which is exactly the the opposite i need. is using skip_before_filter the rails way to exclude before_filter for a certain controller?

You can use :only and :except with skip_before_filter, so put the skip in the specific controller, specifying which actions to skip in that controller.

Colin