add folders structure

This commit is contained in:
Alex Turchyn
2023-09-22 02:20:38 +03:00
parent f8712a9da9
commit 380f553a17
30 changed files with 405 additions and 56 deletions
@@ -4,7 +4,7 @@ class TemplatesArchivedController < ApplicationController
load_and_authorize_resource :template, parent: false
def index
@templates = @templates.where.not(deleted_at: nil).preload(:author).order(id: :desc)
@templates = @templates.where.not(deleted_at: nil).preload(:author, :folder).order(id: :desc)
@templates = Templates.search(@templates, params[:q])
@pagy, @templates = pagy(@templates, items: 12)