add template preferences

This commit is contained in:
Pete Matsyburka committed 2024-04-17 16:09:09 +03:00
1 parent fefd138dfd
commit 1e57c1ace7
18 files changed
+317 -9

No files matched your search

@@ -0,0 +1,22 @@
# frozen_string_literal: true
class TemplatesPreferencesController < ApplicationController
load_and_authorize_resource :template
def show; end
def create
authorize!(:update, @template)
@template.preferences = @template.preferences.merge(template_params[:preferences])
@template.save!
head :ok
end
private
def template_params
params.require(:template).permit(preferences: %i[bcc_completed request_email_subject request_email_body])
end
end