small fix from id to title.
This commit is contained in:
parent
d4adfc6b0e
commit
dc5e24dcf2
|
|
@ -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"=>"<option value=\"#{tag[:value]}\" #{tag[:is_selected]}>#{tag[:name]}</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" => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue