style template show page

This commit is contained in:
Alex Turchyn
2023-06-29 02:04:17 +03:00
parent ed157dc952
commit d0c7d449d5
26 changed files with 213 additions and 287 deletions
+4 -2
View File
@@ -4,9 +4,11 @@ class TemplatesController < ApplicationController
before_action :load_base_template, only: %i[new create]
def show
@template = current_account.templates.find(params[:id])
@template = current_account.templates.active.find(params[:id])
@pagy, @submissions = pagy(@template.submissions.active)
@pagy, @submissions = pagy(@template.submissions.active.preload(:submitters).order(id: :desc))
rescue ActiveRecord::RecordNotFound
redirect_to root_path
end
def new