This is a two part question. I\'m needing to restrict a rails site that I\'m throwing on development server to only a few IP addresses, so the public can\'t access it. (Basi
I didn't know you could do this through routes, my approach would be to just have a before_filter in the ApplicationController and just have something that does:
before_filter :protect
def protect
@ips = ['127.0.0.1', '203.123.10.1'] #And so on ...]
if not @ips.include? request.remote_ip
# Check for your subnet stuff here, for example
# if not request.remote_ip.include?('127.0,0')
render :text => "You are unauthorized"
return
end
end