Added ability to delete IP addresses
This commit is contained in:
parent
2b6a222bcf
commit
57c5fb30c6
@ -28,4 +28,11 @@ namespace '/ip-tracker' do
|
|||||||
redirect '/ip-tracker'
|
redirect '/ip-tracker'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
get '/delete/:ip_id' do
|
||||||
|
ip = IpAddress.where(id: params[:ip_id]).first()
|
||||||
|
ip.delete()
|
||||||
|
|
||||||
|
redirect '/ip-tracker'
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<th>Address</th>
|
<th>Address</th>
|
||||||
<th>DNS Name</th>
|
<th>DNS Name</th>
|
||||||
<th>Comments</th>
|
<th>Comments</th>
|
||||||
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -16,6 +17,9 @@
|
|||||||
<td><%= ip.address %></td>
|
<td><%= ip.address %></td>
|
||||||
<td><%= ip.dns_name %></td>
|
<td><%= ip.dns_name %></td>
|
||||||
<td><%= ip.comment %></td>
|
<td><%= ip.comment %></td>
|
||||||
|
<td>
|
||||||
|
<a href="/ip-tracker/delete/<%= ip.id %>"><i class="fa-solid fa-trash"></i></a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
Loading…
Reference in New Issue
Block a user