mirror of https://github.com/docusealco/docuseal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
619 B
24 lines
619 B
# frozen_string_literal: true
|
|
|
|
class TemplatesFoldersController < ApplicationController
|
|
load_and_authorize_resource :template
|
|
|
|
def edit; end
|
|
|
|
def update
|
|
@template.folder = TemplateFolders.find_or_create_by_name(current_user, params[:name])
|
|
|
|
if @template.save
|
|
redirect_back(fallback_location: template_path(@template), notice: 'Document template has been moved')
|
|
else
|
|
redirect_back(fallback_location: template_path(@template), notice: 'Unable to move template into folder')
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def template_folder_params
|
|
params.require(:template_folder).permit(:name)
|
|
end
|
|
end
|