mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
tags filter fix
This commit is contained in:
parent
6eb740af58
commit
2f2bf0e290
@ -51,7 +51,8 @@ class DocumentsController < ApplicationController
|
||||
|
||||
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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user