Skip before_filter in Rails Skip before_filter in Rails ruby-on-rails ruby-on-rails

Skip before_filter in Rails


class Dog < Animal  skip_before_filter :authenticate, :only => :showend

See ActionController::Filters::ClassMethods for more info on filters and inheritance.


The two answers given are half right. In order to avoid making all your dog actions open, you need to qualify the skip_before_filter to only apply to the 'show' action as follows:

class Dog < Animal  skip_before_filter :authenticate, :only => :showend


For this you can use skip_before_filter

It's explained in the Rails API

In your example dogjust would have to contain

skip_before_filter :authenticate