Skip_before_filter based on request

I would like to call skip_before_filter based on the request object.

pseudo code:

skip_before_filter :authorize_user, :if => lambda { |controller| controller.request.ip == '127.0.0.1'

Is this possible, it seems you only get: only /: except with skip_filter's.

+3
source share
1 answer

This should work

skip_before_filter :authorize_user, :if => Proc.new {|c| c.request.remote_ip == '127.0.0.1'}
+6
source

Source: https://habr.com/ru/post/1796287/


All Articles