1
我试图基于某个IP进行身份验证,如果IP不正确,则访问应该是不允许的。使用application_controller只从某个ip认证可能吗?
林:
before_filter :authenticate
def authenticate
authenticate_or_request_with_http_basic do |username, password|
username == "admin" && password == "talkmate"
end
end
什么是增加检查IP,如果IP是不是一定值时禁止访问正确的方法是什么?
thx完全做到了! – Rubytastic 2012-04-04 13:09:40
接受它然后:) – 2012-04-04 13:14:47
Coudent接受我不得不等待几分钟,完成;)thx再次 – Rubytastic 2012-04-04 13:17:48