Ruby on rails 跳过基于'的前#u过滤器;请求';
我想根据请求对象调用“先跳过后跳过”过滤器 伪代码:Ruby on rails 跳过基于'的前#u过滤器;请求';,ruby-on-rails,Ruby On Rails,我想根据请求对象调用“先跳过后跳过”过滤器 伪代码: skip_before_filter :authorize_user, :if => lambda { |controller| controller.request.ip == '127.0.0.1' 这是否可能,您似乎只得到:only/:除了跳过过滤器之外。这应该是可行的 skip_before_filter :authorize_user, :if => Proc.new {|c| c.request.remote_ip
skip_before_filter :authorize_user, :if => lambda { |controller| controller.request.ip == '127.0.0.1'
这是否可能,您似乎只得到:only/:除了跳过过滤器之外。这应该是可行的
skip_before_filter :authorize_user, :if => Proc.new {|c| c.request.remote_ip == '127.0.0.1'}
这对我不管用。这是在什么版本的Rails上工作的?3.2.12这对我很有用。Ruby 2.0语法:
:if->{request.remote_ip='127.0.0.1'}