From dc5e24dcf2175cb1088b387001c5962965ed5595 Mon Sep 17 00:00:00 2001 From: rulingcom Date: Tue, 22 Apr 2025 16:47:28 +0800 Subject: [PATCH] small fix from id to title. --- app/controllers/video_pros_controller.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/video_pros_controller.rb b/app/controllers/video_pros_controller.rb index 5c3db11..23ff6f8 100644 --- a/app/controllers/video_pros_controller.rb +++ b/app/controllers/video_pros_controller.rb @@ -143,8 +143,12 @@ class VideoProsController < ApplicationController end end + hashtag = nil if params[:hashtag].present? - video_images = video_images.where(video_tag_ids: params[:hashtag]) + hashtag = VideoTag.where(:title => params[:hashtag]).first rescue nil + if !hashtag.nil? + video_images = video_images.where(video_tag_ids: hashtag.id) + end end custom_data_field = (page.custom_data_field || {} rescue {}) @@ -162,8 +166,9 @@ class VideoProsController < ApplicationController {"option"=>""} end + hashtag_id = hashtag.id.to_s rescue nil hashtags = VideoTag.all.map do |tag| - {"hashtag" => tag.title, "hash_url" => request.base_url + request.path + "?hashtag=#{tag.id.to_s}", "selected" => (params[:hashtag] == tag.id.to_s ? "selected" : "")} + {"hashtag" => tag.title, "hash_url" => request.base_url + request.path + "?hashtag=#{tag.title}", "selected" => (hashtag_id == tag.id.to_s ? "selected" : "")} end { "extras" => {