diff --git a/lib/routes/ip_tracker.rb b/lib/routes/ip_tracker.rb index eb1fddc..0cfe300 100644 --- a/lib/routes/ip_tracker.rb +++ b/lib/routes/ip_tracker.rb @@ -28,4 +28,11 @@ namespace '/ip-tracker' do redirect '/ip-tracker' end + get '/delete/:ip_id' do + ip = IpAddress.where(id: params[:ip_id]).first() + ip.delete() + + redirect '/ip-tracker' + end + end diff --git a/views/ip/ip-tracker.erb b/views/ip/ip-tracker.erb index c206d3d..a02ebe5 100644 --- a/views/ip/ip-tracker.erb +++ b/views/ip/ip-tracker.erb @@ -8,6 +8,7 @@