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'
|
||||
end
|
||||
|
||||
get '/delete/:ip_id' do
|
||||
ip = IpAddress.where(id: params[:ip_id]).first()
|
||||
ip.delete()
|
||||
|
||||
redirect '/ip-tracker'
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -8,6 +8,7 @@
|
||||
<th>Address</th>
|
||||
<th>DNS Name</th>
|
||||
<th>Comments</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -16,6 +17,9 @@
|
||||
<td><%= ip.address %></td>
|
||||
<td><%= ip.dns_name %></td>
|
||||
<td><%= ip.comment %></td>
|
||||
<td>
|
||||
<a href="/ip-tracker/delete/<%= ip.id %>"><i class="fa-solid fa-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
Loading…
Reference in New Issue
Block a user