why don't you use a constraint on routing ? ( got it from some
example...)
in route.rb
at the beginning of your routes.rb you write
class BlacklistConstraint
def initialize
@ips = Blacklist.retrieve_ips
end
def matches?(request)
@ips.include?(request.remote_ip)
end
end
then later you blacklist or whitelist
match "/some_route" => "blacklist#index", :constraints =>
BlacklistConstraint.new
look at the Rails routing doc...
On Jun 23, 5:22 am, Christian Fazzini <
christian.fazz...@gmail.com>
wrote: