Convert index tables to using table builder
This commit is contained in:
@@ -2,22 +2,13 @@
|
||||
<%= link_to "Find all IP addresses associated with these users", ip_addresses_path(search: { user_id: @ip_addresses.map(&:user_id).join(" "), group_by: "ip_addr" }) %>
|
||||
</p>
|
||||
|
||||
<table class="striped autofit">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Uses</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @ip_addresses.each do |ip| %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= link_to_user ip.user %>
|
||||
<%= link_to "»", ip_addresses_path(search: { user_id: ip.user_id, group_by: "ip_addr" }) %>
|
||||
</td>
|
||||
<td><%= link_to ip.count_all, ip_addresses_path(search: { user_id: ip.user_id, ip_addr: params[:search][:ip_addr] }) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= table_for @ip_addresses, {class: "striped autofit"} do |t| %>
|
||||
<% t.column "User" do |ip| %>
|
||||
<%= link_to_user ip.user %>
|
||||
<%= link_to "»", ip_addresses_path(search: { user_id: ip.user_id, group_by: "ip_addr" }) %>
|
||||
<% end %>
|
||||
<% t.column "Uses" do |ip| %>
|
||||
<%= link_to ip.count_all, ip_addresses_path(search: { user_id: ip.user_id, ip_addr: params[:search][:ip_addr] }) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user