From 47c71a3935ae2e519f693780add0ece9ff0ce481 Mon Sep 17 00:00:00 2001 From: Roscoe Date: Fri, 30 Jan 2026 02:21:01 +0000 Subject: [PATCH] show tags in places --- app/views/clips/index.html.erb | 8 +++++++- app/views/clips/show.html.erb | 34 +++++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/app/views/clips/index.html.erb b/app/views/clips/index.html.erb index 2f08464..94d7053 100644 --- a/app/views/clips/index.html.erb +++ b/app/views/clips/index.html.erb @@ -10,6 +10,7 @@ Category Updated at Created at + Tags <% @clips.each do |clip| %> @@ -31,6 +32,11 @@ <%= clip.created_at %> + + <% clip.tags.each_with_index do |tag, index| %> + <%= link_to tag.name, tag_path(tag) %><% if index < clip.tags.size - 1 %>, <% end %> + <% end %> + <% end %> - \ No newline at end of file + diff --git a/app/views/clips/show.html.erb b/app/views/clips/show.html.erb index 0d28ad3..b682a03 100644 --- a/app/views/clips/show.html.erb +++ b/app/views/clips/show.html.erb @@ -1,7 +1,7 @@ <% cache @clip do %>

<%= @clip.title %>

<% end %> - +
<% if @clip.video.attached? %> <% end %>
@@ -9,19 +9,31 @@ - +
+ + + + - + + + + + @@ -30,14 +42,14 @@ - - - + <% if authenticated? %> + + + + <% end %>
Clip ID:<%= @clip.id %>
Category: <%= link_to @clip.category.name, @clip.category %>
Tags:<%= @clip.tags.map(&:name).join(', ') %> + <% @clip.tags.each_with_index do |tag, index| %> + <%= link_to tag.name, tag_path(tag) %><% if index < @clip.tags.size - 1 %>, <% end %> + <% end %> +
Length: <%= seconds_to_time(@clip.video.metadata["duration"]) %>
Resolution:<%= @clip.video.metadata["width"].round %>x<%= @clip.video.metadata["height"].round %> (<%= get_video_aspect(@clip.video) %>)
Last Updated: <%= @clip.updated_at %>Created: <%= @clip.created_at %>
- <% if authenticated? %> - <%= button_to "Edit", edit_clip_path(@clip), :method => "get" %> - <%= button_to "Delete", @clip, method: :delete, data: { turbo_confirm: "Are you sure?" } %> - <% end %> -
+ <%= button_to "Edit", edit_clip_path(@clip), :method => "get" %> + <%= button_to "Delete", @clip, method: :delete, data: { turbo_confirm: "Are you sure?" } %> +