diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index fdbfab5..d5f14c6 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -6,6 +6,7 @@ class TagsController < ApplicationController end def show + @clips = Clip.joins(:tags).where(tags: { id: @tag.id }) end def new diff --git a/app/views/tags/show.html.erb b/app/views/tags/show.html.erb index e42470d..0bcaea1 100644 --- a/app/views/tags/show.html.erb +++ b/app/views/tags/show.html.erb @@ -1,7 +1,40 @@ <% cache @tag do %> -

<%= @tag.name %>

+

Clips tagged with
<%= @tag.name %>

<% end %> + + + + + + + + + + <% @clips.each do |clip| %> + + + + + + + + + <% end %> +
PreviewTitleDurationCategoryUpdated atCreated at
+ <%= link_to (image_tag url_for(clip.video.preview(resize_to_limit: [160, 120]).processed)), clip %> + + <%= link_to clip.title, clip %> + + <%= seconds_to_time(clip.video.metadata["duration"]) %> + + <%= clip.category.name %> + + <%= clip.updated_at %> + + <%= clip.created_at %> +
+ <%= link_to "Back", tags_path%> <% if authenticated? %> <%= link_to "Edit", edit_tag_path(@tag) %>