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 %>
| Preview | +Title | +Duration | +Category | +Updated at | +Created 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 %> + | +