Anu
Joined: 01 Jan 2010 Posts: 80
|
Posted: Wed Feb 10, 2010 1:13 pm Post subject: Filter chain skipping |
|
|
Hi,
When we declare a filter on a base class it will applies to its all subclasses.
but sometimes a subclass need not some filters and have to skip from some of its superclass filters.
For example:
class ApplicationController < ActionController::Base
before_filter :authenticate
end
class SignupController < ApplicationController
skip_before_filter :authenticate
end
class ProjectsController < ApplicationController
skip_filter :catch_exceptions
end
class ClientsController < ApplicationController
skip_filter :catch_exceptions, :authenticate, :except => :index
end
in the skip_filter the authenticate and catch_exceptions got skipped.
Thanks & Regards,
Anasuya.N |
|