开发者

refinerycms constraints breaks routes

i'm running rails 3.0.10 on ruby-1.8.7p352. i installed refinerycms 1.0开发者_如何学Go.8 and tried to block all access to the backend for all ip's except a whitelist. i did it by editing my routes.rb to:

TestWhitelist::Application.routes.draw do
  match "/refinery" => redirect( "/" ), :constraints => lambda{ |req| req.remote_ip != "127.0.0.1" }
end

This approach works great if i try to access /refinery from another ip than 127.0.0.1. if i try to access /refinery from 127.0.0.1 i get a "No route matches /refinery".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜