style template show page

This commit is contained in:
Alex Turchyn committed 2023-06-29 02:23:01 +03:00
1 parent ed157dc952
commit d0c7d449d5
26 files changed
+213 -287

No files matched your search

+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