/artist_urls: convert to table builder.

This commit is contained in:
evazion
2020-01-07 00:44:06 -06:00
parent 6e86ca750e
commit ef89e7321f

View File

@@ -11,32 +11,27 @@
<%= f.submit "Search" %> <%= f.submit "Search" %>
<% end %> <% end %>
<table class="striped" width="100%"> <%= table_for @artist_urls, width: "100%" do |t| %>
<thead> <% t.column :id %>
<tr> <% t.column "Artist Name" do |artist_url| %>
<th>ID</th> <%= link_to(artist_url.artist.name, artist_url.artist) %>
<th>Artist Name</th> <% end %>
<th>URL</th> <% t.column "URL" do |artist_url| %>
<th>Normalized URL</th> <%= external_link_to(artist_url.url.to_s) %>
<th>Active?</th> <% end %>
<th>Created</th> <% t.column "Normalized URL" do |artist_url| %>
<th>Updated</th> <%= external_link_to(artist_url.normalized_url) %>
</tr> <% end %>
</thead> <% t.column "Active?" do |artist_url| %>
<tbody> <%= artist_url.is_active.to_s %>
<% @artist_urls.each do |artist_url| %> <% end %>
<tr> <% t.column "Created" do |artist_url| %>
<%= tag.td artist_url.id %> <%= compact_time(artist_url.created_at) %>
<%= tag.td link_to(artist_url.artist.name, artist_url.artist) %> <% end %>
<%= tag.td external_link_to(artist_url.url.to_s) %> <% t.column "Updated" do |artist_url| %>
<%= tag.td external_link_to(artist_url.normalized_url) %> <%= compact_time(artist_url.updated_at) %>
<%= tag.td artist_url.is_active.to_s %> <% end %>
<%= tag.td compact_time(artist_url.created_at) %> <% end %>
<%= tag.td compact_time(artist_url.updated_at) %>
</tr>
<% end %>
</tbody>
</table>
<%= numbered_paginator(@artist_urls) %> <%= numbered_paginator(@artist_urls) %>
</div> </div>