Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tags filter fix
  • Loading branch information
drusepth committed Jul 5, 2021
commit 2f2bf0e290bd7e252a5114645ad4e7ca90fd0c88
3 changes: 2 additions & 1 deletion app/controllers/documents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def index

if params.key?(:tag)
@filtered_page_tags = @page_tags.where(slug: params[:tag])
@documents.select! { |document| @filtered_page_tags.pluck(:page_id).include?(document.id) }
@documents = @documents.to_a.select { |document| @filtered_page_tags.pluck(:page_id).include?(document.id) }
# @documents = @documents.where(page_tags: { slug: params[:tag] })
end

@page_tags = @page_tags.uniq(&:tag)
Expand Down