Answer the question
In order to leave comments, you need to log in
How to exclude a specific controller method in before_filter in Ruby on Rails?
Let's say there is a uses/new method, in routes there is also an alias 'registration' => 'users#new'.
So I write:before_filter :authorize, :except => ['user/new']
before_filter :authorize, :except => ['registartion']
--- does not work. Answer the question
In order to leave comments, you need to log in
Hello, I think this is what you need. Use skip_before_action in the controller you need.
before_action only: :new do |controller|
authenticate unless controller.class.name == 'UsersController'
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question